activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r378218 - in /incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc: TransactionContext.java adapter/OracleJDBCAdapter.java
Date Thu, 16 Feb 2006 10:36:01 GMT
Author: jstrachan
Date: Thu Feb 16 02:35:59 2006
New Revision: 378218

URL: http://svn.apache.org/viewcvs?rev=378218&view=rev
Log:
Applied patch from haliq for AMQ-574

Modified:
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/TransactionContext.java
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/OracleJDBCAdapter.java

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/TransactionContext.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/TransactionContext.java?rev=378218&r1=378217&r2=378218&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/TransactionContext.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/TransactionContext.java
Thu Feb 16 02:35:59 2006
@@ -20,6 +20,7 @@
 import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.SQLException;
+import java.sql.Statement;
 
 import javax.sql.DataSource;
 
@@ -90,8 +91,9 @@
         try {
             int[] rc = p.executeBatch();
             for (int i = 0; i < rc.length; i++) {
-                if ( rc[i]!= 1 ) {
-                    throw new SQLException(message);
+                int code = rc[i];
+                if ( code > 0 || code == Statement.SUCCESS_NO_INFO ) {
+                    throw new SQLException(message + ". Response code: " + code);
                 }
             }
         } finally {

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/OracleJDBCAdapter.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/OracleJDBCAdapter.java?rev=378218&r1=378217&r2=378218&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/OracleJDBCAdapter.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/OracleJDBCAdapter.java
Thu Feb 16 02:35:59 2006
@@ -51,7 +51,7 @@
     
     protected byte[] getBinaryData(ResultSet rs, int index) throws SQLException {
         // Get as a BLOB
-        Blob aBlob = rs.getBlob(1);
+        Blob aBlob = rs.getBlob(index);
         return aBlob.getBytes(1, (int) aBlob.length());
     }
 }



Mime
View raw message