Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
2011-05-08 20:11:56,684 INFO [Log4jLogger] : DataObjects::SQLError - DSRA9122E: class com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement enthält keine Objekte vom Typ interface oracle.jdbc.OraclePreparedStatement.:
C:/Program Files (x86)/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/WEB-WINDOWS7DEVNode01Cell/bds_war.ear/bds.war/WEB-INF/bundle/jruby/1.8/gems/dm-do-adapter-1.1.0/lib/dm-do-adapter/adapter.rb:276:in `with_connection'
C:/Program Files (x86)/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/WEB-WINDOWS7DEVNode01Cell/bds_war.ear/bds.war/WEB-INF/bundle/jruby/1.8/gems/dm-do-adapter-1.1.0/lib/dm-do-adapter/adapter.rb:113:in `create'
C:/Program Files (x86)/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/WEB-WINDOWS7DEVNode01Cell/bds_war.ear/bds.war/WEB-INF/bundle/jruby/1.8/gems/dm-do-adapter-1.1.0/lib/dm-do-adapter/adapter.rb:85:in `each'
C:/Program Files (x86)/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/WEB-WINDOWS7DEVNode01Cell/bds_war.ear/bds.war/WEB-INF/bundle/jruby/1.8/gems/dm-do-adapter-1.1.0/lib/dm-do-adapter/adapter.rb:85:in `create'
C:/Program Files (x86)/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/WEB-WINDOWS7DEVNode01Cell/bds_war.ear/bds.war/WEB-INF/bundle/jruby/1.8/gems/dm-core-1.1.0/lib/dm-core/repository.rb:146:in `create'
C:/Program Files (x86)/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/WEB-WINDOWS7DEVNode01Cell/bds_war.ear/bds.war/WEB-INF/bundle/jruby/1.8/gems/dm-core-1.1.0/lib/dm-core/resource/state/transient.rb:61:in `create_resource'
C:/Program Files (x86)/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/WEB-WINDOWS7DEVNode01Cell/bds_war.ear/bds.war/WEB-INF/bundle/jruby/1.8/gems/dm-core-1.1.0/lib/dm-core/resource/state/transient.rb:25:in `commit'
C:/Program Files (x86)/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/WEB-WINDOWS7DEVNode01Cell/bds_war.ear/bds.war/WEB-INF/bundle/jruby/1.8/gems/dm-core-1.1.0/lib/dm-c
@pietia

This comment has been minimized.

Copy link
Owner Author

@pietia pietia commented May 8, 2011

EN:
class com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement does not wrap any objects of type interface oracle.jdbc.OraclePreparedStatement

@pietia

This comment has been minimized.

Copy link
Owner Author

@pietia pietia commented May 8, 2011

diff --git a/do_oracle/ext-java/src/main/java/do_oracle/OracleDriverDefinition.java b/do_oracle/ext-java/src/main/java/do_oracle/OracleDriverDefinition.java
index b52753a..09cc4fb 100644
--- a/do_oracle/ext-java/src/main/java/do_oracle/OracleDriverDefinition.java
+++ b/do_oracle/ext-java/src/main/java/do_oracle/OracleDriverDefinition.java
@@ -10,6 +10,8 @@ import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Types;
+
+import com.ibm.websphere.rsadapter.WSCallHelper;
import oracle.jdbc.OraclePreparedStatement;
import oracle.jdbc.OracleTypes;

@@ -147,11 +149,15 @@ public class OracleDriverDefinition extends AbstractDriverDefinition {
*/
@override
public boolean registerPreparedStatementReturnParam(String sqlText, PreparedStatement ps, int idx) throws SQLException {

  •    OraclePreparedStatement ops = (OraclePreparedStatement) ps;
    
  •    //OraclePreparedStatement ops = (OraclePreparedStatement) ps;
     Pattern p = Pattern.compile("^\s*INSERT.+RETURNING.+INTO\s+", Pattern.CASE_INSENSITIVE);
     Matcher m = p.matcher(sqlText);
     if (m.find()) {
    
  •        ops.registerReturnParameter(idx, Types.BIGINT);
    
  •        WSCallHelper.jdbcCall(oracle.jdbc.OraclePreparedStatement.class, ps,
    
  •                              "registerReturnParameter",
    
  •                              new Object[]{idx, Types.BIGINT},
    
  •                              new Class[]{int.class, int.class});
    
  •        //ops.registerReturnParameter(idx, Types.BIGINT);
         return true;
     }
     return false;
    
    @@ -165,8 +171,10 @@ public class OracleDriverDefinition extends AbstractDriverDefinition {
    */
    @override
    public long getPreparedStatementReturnParam(PreparedStatement ps) throws SQLException {
  •    OraclePreparedStatement ops = (OraclePreparedStatement) ps;
    
  •    ResultSet rs = ops.getReturnResultSet();
    
  •    //OraclePreparedStatement ops = (OraclePreparedStatement) ps;
    
  •    //ResultSet rs = ops.getReturnResultSet();
    
  •    ResultSet rs = (ResultSet) WSCallHelper.jdbcCall(oracle.jdbc.OraclePreparedStatement.class, ps,
    
  •                                                     "getReturnResultSet", new Object[]{}, new Class[]{});
     try {
         if (rs.next()) {
             // Assuming that primary key will not be larger as long max value
    
    @@ -308,6 +316,9 @@ public class OracleDriverDefinition extends AbstractDriverDefinition {
    • @return
      */
      private Object getFieldValue(Object obj, String field) {
  •    if(obj == null)
    
  •        return null;
    
    • Class c = obj.getClass();
      while (c != null) {
      try {
@myabc

This comment has been minimized.

Copy link

@myabc myabc commented Dec 11, 2012

I am looking through my old gists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.