sql >> Base de Datos >  >> RDS >> Oracle

¿Hay alguna manera de superar DSRA9010E 'setReadOnly' no es compatible con la excepción de WebSphere?

Intenta desenvolver la connection objeto como este:

Context ic = new InitialContext();
DataSource ds = (DataSource)ic.lookup("jdbc/OracleDS");
Connection conn = ds.getConnection();

if (conn.isWrapperFor(oracle.jdbc.OracleConnection.class)) {
     // Returns an object that implements the given interface to
     // allow access to non-standard methods, or standard methods
     // not exposed by the proxy.
     oracle.jdbc.OracleConnection oraCon = conn.unwrap(oracle.jdbc.OracleConnection.class);
     // Do some Oracle-specific work here.
     oraCon.setReadOnly(readOnly);
     ....

}
conn.close(); 

Consulte WebSphere Application Server y JDBC 4.0 Wrapper Pattern