activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r1207963 - in /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter: OracleBlobJDBCAdapter.java OracleJDBCAdapter.java
Date Tue, 29 Nov 2011 16:49:03 GMT
Author: gtully
Date: Tue Nov 29 16:49:02 2011
New Revision: 1207963

URL: http://svn.apache.org/viewvc?rev=1207963&view=rev
Log:
https://issues.apache.org/jira/browse/AMQ-3611 - Revert the Oracle jdbc adapter to a variant
of the default jdbc adapter in place of the one supporting blobs. added oracleBlobJDBCAdapter
for backward compatibility and latest oracle adapter extends the default adapter so it no
longer manipulates blobs directly, works fine with the latest ojdbc6 driver

Added:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/OracleBlobJDBCAdapter.java
  (contents, props changed)
      - copied, changed from r1207715, activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/OracleJDBCAdapter.java
Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/OracleJDBCAdapter.java

Copied: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/OracleBlobJDBCAdapter.java
(from r1207715, activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/OracleJDBCAdapter.java)
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/OracleBlobJDBCAdapter.java?p2=activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/OracleBlobJDBCAdapter.java&p1=activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/OracleJDBCAdapter.java&r1=1207715&r2=1207963&rev=1207963&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/OracleJDBCAdapter.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/OracleBlobJDBCAdapter.java
Tue Nov 29 16:49:02 2011
@@ -19,7 +19,6 @@ package org.apache.activemq.store.jdbc.a
 import java.sql.Blob;
 import java.sql.ResultSet;
 import java.sql.SQLException;
-
 import org.apache.activemq.store.jdbc.Statements;
 
 /**
@@ -38,11 +37,11 @@ import org.apache.activemq.store.jdbc.St
  * <li></li>
  * </ul>
  *
- * @org.apache.xbean.XBean element="oracleJDBCAdapter"
+ * @org.apache.xbean.XBean element="oracleBlobJDBCAdapter"
  *
  * 
  */
-public class OracleJDBCAdapter extends BlobJDBCAdapter {
+public class OracleBlobJDBCAdapter extends BlobJDBCAdapter {
 
     @Override
     public void setStatements(Statements statements) {

Propchange: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/OracleBlobJDBCAdapter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/OracleJDBCAdapter.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/OracleJDBCAdapter.java?rev=1207963&r1=1207962&r2=1207963&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/OracleJDBCAdapter.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/OracleJDBCAdapter.java
Tue Nov 29 16:49:02 2011
@@ -30,44 +30,17 @@ import org.apache.activemq.store.jdbc.St
  * implementation of methods to account for differences
  * in JDBC Driver implementations.
  * <p/>
- * The JDBCAdapter inserts and extracts BLOB data using the
- * getBytes()/setBytes() operations.
- * <p/>
- * The databases/JDBC drivers that use this adapter are:
- * <ul>
- * <li></li>
- * </ul>
  *
  * @org.apache.xbean.XBean element="oracleJDBCAdapter"
  *
  * 
  */
-public class OracleJDBCAdapter extends BlobJDBCAdapter {
+public class OracleJDBCAdapter extends DefaultJDBCAdapter {
 
     @Override
     public void setStatements(Statements statements) {
         statements.setLongDataType("NUMBER");
         statements.setSequenceDataType("NUMBER");
-
-        String addMessageStatement = "INSERT INTO "
-            + statements.getFullMessageTableName()
-            + "(ID, MSGID_PROD, MSGID_SEQ, CONTAINER, EXPIRATION, PRIORITY, MSG) VALUES (?,
?, ?, ?, ?, ?, empty_blob())";
-        statements.setAddMessageStatement(addMessageStatement);
-
-        String findMessageByIdStatement = "SELECT MSG FROM " +
-        	statements.getFullMessageTableName() + " WHERE ID=? FOR UPDATE";
-        statements.setFindMessageByIdStatement(findMessageByIdStatement);
-
         super.setStatements(statements);
     }
-
-    @Override
-    protected byte[] getBinaryData(ResultSet rs, int index) throws SQLException {
-        // Get as a BLOB
-        Blob aBlob = rs.getBlob(index);
-        if (aBlob == null) {
-            return null;
-        }
-        return aBlob.getBytes(1, (int) aBlob.length());
-    }
 }



Mime
View raw message