Struts and Oracle JDBC extension

hi all,
When I try to use the Oracle JDBC extension to take advantage of the Oracle batch update feature, I got an
exception "org.apache.commons.dbcp.DelegatingPreparedStatement"
It happens when I try to cast a PrepareStatement to OraclePreparedStatement. (It works fine without the cast)
Any idea why?
Here is the code snippet:
ServletContext context = servlet.getServletContext();
DataSource ds = (DataSource) context.getAttribute(Action.DATA_SOURCE_KEY);
try {
Connection conn = ds.getConnection();
String sql = "SELECT username FROM users";
OraclePreparedStatement ps = (OraclePreparedStatement) conn.prepareStatement(sql);
ResultSet rset = ps.executeQuery();
} catch ( Exception e ) {
System.out.println( e.getMessage() );
struts_config.xml:
<data-sources>
<data-source>
<!-- set-property property="driverClass" value="oracle.jdbc.driver.OracleDriver"/ -->
<set-property property="driverClass" value="oracle.jdbc.OracleDriver"/>
<set-property property="url" value="jdbc:oracle:thin:@hostname:1522:db"/>
<set-property property="maxCount" value="5"/>
<set-property property="minCount" value="1"/>
<set-property property="user" value="xxx"/>
<set-property property="password" value="xxx"/>
</data-source>
</data-sources>
Thanks for any help!

Hi scsi-boy:
I have no trouble reading a Timestamp from Oracle...it's trying to write or update one (and unfortunately, I have to do as I said to get it done).
you shouldn't have to import the oracle sql package
That's precisely the point -- I am not trying to use any Oracle specific stuff.. It wouldn't be all that difficult for them to do the casting inside of the driver, instead they just add the following comments to their example:
       // Writing data to Lobs:
        // There are no methods to do this with java.sql.Clob/Blob. 
        // For oracle.sql.CLOB there is getAsciiOutputStream() to write via
        // an ascii stream and getCharacterOutputStream() to write via a
         // unicode one, plus putChars() to write a char array and putString()
         // to write a String - both at a given position within the Clob.  For
         // oracle.sql.BLOB there is getBinaryOutputStream() and putBytes(). 
        // There are also oracle.jdbc.driver classes to do similar that
        // take oracle.sql.CLOB/BLOB as appropriate, namely:
        //       OracleBlobOutputStream()
        //       OracleClobOutputStream()
        //       OracleClobWriter()
        // (Note all three classes have corresponding input/reader classes.)
        // Hence to write data to the lobs here it is necessary to cast the
         // Clob and Blob to oracle.sql.CLOB and oracle.sql.BLOB respectively
         // and use one of the methods listed above.  E.g. to append to the
        // clob column:
        ((oracle.sql.CLOB)c_lob).putString( (int)c_lob.length()+1, "\nBye!" );The example can be found at the link shown below (you may have to do a free sign-up to view it):
http://www.experts-exchange.com/Databases/Oracle/Q_20358143.html
;o)
V.V.

Similar Messages

  • Workaround for using Oracle JDBC extension with WLS pooling

    Reading the newsgroup I saw that many of us encountered the problems
    with ClassCastException when tried to use Oracle JDBC extension
    with WLS pooling. I also had.
    In this case BEA recommends to use dangerous
    method getVendorConnection() which exposes
    the physical connection object to your code.
    Yes it's really dangerous because of unsafe usage may breaks
    WLS pooled connection(s).
    Moreover, this practice will make your JDBC code
    unportable (your JDBC code in addition to Oracle dependence
    became Weblogic dependent):
    void doSmth() {
    Connection con = ...;
    Connection vCon = ((WLConnection)con).getVendorConnection();
    // + mess of usage con in one places and vCon in others
    // (where Oracle extensions are needed)
    // !Don't forget to don't close vCon!
    Sux.
    I found the workaround.
    Introduction
    ============
    Yes the real cause of ClassCastException is that
    in depth of Oracle driver the casting
    to class oracle.jdbc.driver.OracleConnection
    (not to interface oracle.jdbc.OracleConnection)
    is performed.
    Someone can say that this is bug or pure desing.
    Weblogic pooled connection provide dynamic
    implementation for all public interfaces
    which real physical (wrapped) connection object implements.
    Great feature!
    But I guess that all interface methods implemented
    by simple call-delegation to physical (wrapped) connection object.
    In case of oracle.jdbc.OracleConnection interface
    this approach doesn't work for at least one its method:
    public OracleConnection unwrap()
    WLS pooled connection shoudn't implement this method by
    delegation to physical connection object BUT should
    return physical connection object itself!
    // Wrong implementation of unwrap()
    // delegation is used
    public OracleConnection unwrap() {
    return physicalConnection.unwrap();
    // Right implementation of unwrap()
    // physical connection returned
    public OracleConnection unwrap() {
    return physicalConnection;
    Workaround
    ==========
    1. Develop your own OracleConnection wrapper class:
    import oracle.jdbc.OracleConnection;
    import weblogic.jdbc.extensions.WLConnection;
    public class MyOracleConnectionImpl implements OracleConnection {
    private OracleConnection con;
    public MyOracleConnectionImpl(OracleConnection connection)
    throws SQLException
    this.con = connection;
    public OracleConnection unwrap() {
    return (OracleConnection)
    ((WLConnection)con).getVendorConnection();
    /* Implement all other methods by delegation to con object */
    2. Don't get Connections directly from DataSource --
    develop your own simple (may be static) utility
    class which retrives Connections from dataSource
    and returns them wrapped into your MyOracleConnectionImpl
    to your code from some method:
    puclic abstract class MyConnectionSource {
    public static Connection getConnection() {
    Connection con = // get it from DataSource
    return new MyOracleConnectionImpl((OracleConnection)con);
    3. Add attribute RemoveInfectedConnectionsEnabled="false"
    to definition of your JDBCConnectionPool within config.xml
    You may do it because of you `safely` use vendorConnection --
    you don't expose it to application code.
    4. Enjoy the Oracle JDBC extensions in your code!
    Example:
    Connection con = MyConnectionSource.getConnection;
    ArrayDescriptor add =
    ArrayDescriptor.createDescriptor("your_type", con);
    Hope it helps to someone.
    Best regards,
    Eugene Voytitsky

    Hello Eugene Voytitsky,
    Thanks Eugene Voytitsky for your idea
    I have tried the solution suggested by You, but it did not work.
    It still throws ClassCastException.
    I am sorry for posting the whole code of two classes below.
    I did this to give you more clarity.
    I am also indicating the place where the exception was thrown..
    Please let me know if I am doing something wrong.
    OracleConnection Wrapper class
    package ejbTesting;
    // sql imports
    import java.sql.CallableStatement;
    import java.sql.Connection;
    import java.sql.DatabaseMetaData;
    import java.sql.PreparedStatement;
    import java.sql.SQLException;
    import java.sql.SQLWarning;
    import java.sql.Statement;
    // util imports
    import java.util.Map;
    import java.util.Properties;
    // imports from Oracle Driver Classes
    import oracle.jdbc.OracleConnection;
    import oracle.jdbc.OracleOCIFailover;
    import oracle.jdbc.OracleSavepoint;
    // import from Weblogic extensions
    import weblogic.jdbc.extensions.WLConnection;
    public class WeblogicConnectionWrapper implements OracleConnection
         // oracle connection object
         private OracleConnection connection;
         public WeblogicConnectionWrapper (OracleConnection orclConnection)
              try
                   this.connection = orclConnection;
              catch(Exception unexpected )
                   unexpected.printStackTrace();
         public OracleConnection unwrap()
              try
              // The datasource returns a weblogic.jdbc.pool.Connection
              // This needs to be type casted to weblogic.jdbc.extensions.WLConnection
              // Only this weblogic.jdbc.extensions.WLConnection CAN BE type casted
              // to OracleConnection
         return (OracleConnection) ((WLConnection) connection).getVendorConnection();
         catch(Exception sqlException )
              sqlException.printStackTrace ();
              return null;
         /* Implement all other methods by delegation to connection object */      
    public Connection _getPC()
    return connection._getPC();
    public void archive(int i, int j, String s)
    throws SQLException
    connection.archive(i, j, s);
    public void assertComplete()
    throws SQLException
    connection.assertComplete();
    public void clearWarnings()
    throws SQLException
    connection.clearWarnings();
    public void close()
    throws SQLException
    connection.close();
    public void commit()
    throws SQLException
    connection.commit();
    public Statement createStatement()
    throws SQLException
    return connection.createStatement();
    public Statement createStatement(int i, int j)
    throws SQLException
    return connection.createStatement(i, j);
    public boolean getAutoClose()
    throws SQLException
    return connection.getAutoClose();
    public boolean getAutoCommit()
    throws SQLException
    return connection.getAutoCommit();
    public CallableStatement getCallWithKey(String s)
    throws SQLException
    return connection.getCallWithKey(s);
    public String getCatalog()
    throws SQLException
    return connection.getCatalog();
    public boolean getCreateStatementAsRefCursor()
    return connection.getCreateStatementAsRefCursor();
    public int getDefaultExecuteBatch()
    return connection.getDefaultExecuteBatch();
    public int getDefaultRowPrefetch()
    return connection.getDefaultRowPrefetch();
    public Object getDescriptor(String s)
    return connection.getDescriptor(s);
    public boolean getExplicitCachingEnabled()
    throws SQLException
    return connection.getExplicitCachingEnabled();
    public boolean getImplicitCachingEnabled()
    throws SQLException
    return connection.getImplicitCachingEnabled();
    public boolean getIncludeSynonyms()
    return connection.getIncludeSynonyms();
    public Object getJavaObject(String s)
    throws SQLException
    return connection.getJavaObject(s);
    public DatabaseMetaData getMetaData()
    throws SQLException
    return connection.getMetaData();
    public Properties getProperties()
    return connection.getProperties();
    public boolean getRemarksReporting()
    return connection.getRemarksReporting();
    public boolean getRestrictGetTables()
    return connection.getRestrictGetTables();
    public String getSQLType(Object obj)
    throws SQLException
    return connection.getSQLType(obj);
    public String getSessionTimeZone()
    return connection.getSessionTimeZone();
    public int getStatementCacheSize()
    throws SQLException
    return connection.getStatementCacheSize();
    public PreparedStatement getStatementWithKey(String s)
    throws SQLException
    return connection.getStatementWithKey(s);
    public int getStmtCacheSize()
    return connection.getStmtCacheSize();
    public short getStructAttrCsId()
    throws SQLException
    return connection.getStructAttrCsId();
    public boolean getSynchronousMode()
    return connection.getSynchronousMode();
    public int getTransactionIsolation()
    throws SQLException
    return connection.getTransactionIsolation();
    public Map getTypeMap()
    throws SQLException
    return connection.getTypeMap();
    public String getUserName()
    throws SQLException
    return connection.getUserName();
    public boolean getUsingXAFlag()
    return connection.getUsingXAFlag();
    public SQLWarning getWarnings()
    throws SQLException
    return connection.getWarnings();
    public boolean getXAErrorFlag()
    return connection.getXAErrorFlag();
    public boolean isClosed()
    throws SQLException
    return connection.isClosed();
    public boolean isLogicalConnection()
    return connection.isLogicalConnection();
    public boolean isReadOnly()
    throws SQLException
    return connection.isReadOnly();
    public String nativeSQL(String s)
    throws SQLException
    return connection.nativeSQL(s);
    public Object openJoltConnection(String s, short word0, short word1)
    return connection.openJoltConnection(s, word0, word1);
    public void oracleReleaseSavepoint(OracleSavepoint oraclesavepoint)
    throws SQLException
    connection.oracleReleaseSavepoint(oraclesavepoint);
    public void oracleRollback(OracleSavepoint oraclesavepoint)
    throws SQLException
    connection.oracleRollback(oraclesavepoint);
    public OracleSavepoint oracleSetSavepoint()
    throws SQLException
    return connection.oracleSetSavepoint();
    public OracleSavepoint oracleSetSavepoint(String s)
    throws SQLException
    return connection.oracleSetSavepoint(s);
    public int pingDatabase(int i)
    throws SQLException
    return connection.pingDatabase(i);
    public CallableStatement prepareCall(String s)
    throws SQLException
    return connection.prepareCall(s);
    public CallableStatement prepareCall(String s, int i, int j)
    throws SQLException
    return connection.prepareCall(s, i, j);
    public CallableStatement prepareCallWithKey(String s)
    throws SQLException
    return connection.prepareCallWithKey(s);
    public PreparedStatement prepareStatement(String s)
    throws SQLException
    return connection.prepareStatement(s);
    public PreparedStatement prepareStatement(String s, int i, int j)
    throws SQLException
    return connection.prepareStatement(s, i, j);
    public PreparedStatement prepareStatementWithKey(String s)
    throws SQLException
    return connection.prepareStatementWithKey(s);
    public void purgeExplicitCache()
    throws SQLException
    connection.purgeExplicitCache();
    public void purgeImplicitCache()
    throws SQLException
    connection.purgeImplicitCache();
    public void putDescriptor(String s, Object obj)
    throws SQLException
    connection.putDescriptor(s, obj);
    public void registerApiDescription(String s, short word0, short word1, String
    s1)
    connection.registerApiDescription(s, word0, word1, s1);
    public void registerSQLType(String s, Class class1)
    throws SQLException
    connection.registerSQLType(s, class1);
    public void registerSQLType(String s, String s1)
    throws SQLException
    connection.registerSQLType(s, s1);
    public void registerTAFCallback(OracleOCIFailover oracleocifailover, Object
    obj)
    throws SQLException
    connection.registerTAFCallback(oracleocifailover, obj);
    public void rollback()
    throws SQLException
    connection.rollback();
    public void setAutoClose(boolean flag)
    throws SQLException
    connection.setAutoClose(flag);
    public void setAutoCommit(boolean flag)
    throws SQLException
    connection.setAutoCommit(flag);
    public void setCatalog(String s)
    throws SQLException
    connection.setCatalog(s);
    public void setCreateStatementAsRefCursor(boolean flag)
    connection.setCreateStatementAsRefCursor(flag);
    public void setDefaultExecuteBatch(int i)
    throws SQLException
    connection.setDefaultExecuteBatch(i);
    public void setDefaultRowPrefetch(int i)
    throws SQLException
    connection.setDefaultRowPrefetch(i);
    public void setExplicitCachingEnabled(boolean flag)
    throws SQLException
    connection.setExplicitCachingEnabled(flag);
    public void setImplicitCachingEnabled(boolean flag)
    throws SQLException
    connection.setImplicitCachingEnabled(flag);
    public void setIncludeSynonyms(boolean flag)
    connection.setIncludeSynonyms(flag);
    public void setReadOnly(boolean flag)
    throws SQLException
    connection.setReadOnly(flag);
    public void setRemarksReporting(boolean flag)
    connection.setRemarksReporting(flag);
    public void setRestrictGetTables(boolean flag)
    connection.setRestrictGetTables(flag);
    public void setSessionTimeZone(String s)
    throws SQLException
    connection.setSessionTimeZone(s);
    public void setStatementCacheSize(int i)
    throws SQLException
    connection.setStatementCacheSize(i);
    public void setStmtCacheSize(int i)
    throws SQLException
    connection.setStmtCacheSize(i);
    public void setStmtCacheSize(int i, boolean flag)
    throws SQLException
    connection.setStmtCacheSize(i, flag);
    public void setSynchronousMode(boolean flag)
    connection.setSynchronousMode(flag);
    public void setTransactionIsolation(int i)
    throws SQLException
    connection.setTransactionIsolation(i);
    public void setTypeMap(Map map)
    throws SQLException
    connection.setTypeMap(map);
    public void setUsingXAFlag(boolean flag)
    connection.setUsingXAFlag(flag);
    public void setWrapper(OracleConnection oracleconnection)
    connection.setWrapper(oracleconnection);
    public void setXAErrorFlag(boolean flag)
    connection.setXAErrorFlag(flag);
    public void shutdown(int i)
    throws SQLException
    connection.shutdown(i);
    public void startup(String s, int i)
    throws SQLException
    connection.startup(s, i);
    Util class to get Wrapped Connections from
    datasource
    package ejbTesting;
    // j2ee imports
    import javax.naming.InitialContext;
    import javax.sql.DataSource;
    // sql imports
    import java.sql.Connection;
    // imports from Oracle Driver Classes
    import oracle.jdbc.OracleConnection;
    * Wrapper class for the DataSource Connection from Weblogic pool
    public class DataSourceConnectionWrapper
         // datasource variable
         private static transient DataSource datasource = null;
         private static String dbName = "jdbc/workbench";
    * Method that returns the database connection
         public static Connection getConnection()
              try
                   // initialsing the datasource object
                   initialiseDataSource ();
                   // Getting a connection from the datasource
                   Connection con = datasource.getConnection( );
                   // wrapping it custom wrapper class and
                   // returning the connection object
                   return new WeblogicConnectionWrapper((OracleConnection)con);
              catch(Exception exception )
                   exception.printStackTrace();
                   return null;
         private static void initialiseDataSource( ) throws Exception
    if ( datasource == null )
    try
    InitialContext ic = new InitialContext( );
    datasource = (DataSource) ic.lookup( dbName );
    catch (Exception ne )
    throw new Exception( "NamingException while looking up DataSource with
    JNDI name" +
    dbName + ": \n" + ne.getMessage( ) );
    Exception Stack Trace
    The line 46 in DataSourceConnectionWrapper
    corresponds to
    return new WeblogicConnectionWrapper((OracleConnection)con);
    Which I feel is logical as the connection which we get from Weblogic
    datasource cannot be type casted to OracleConnection
    java.lang.ClassCastException: weblogic.jdbc.pool.Connection
    at ejbTesting.DataSourceConnectionWrapper.getConnection(DataSourceConnectionWrapper.java:46)

  • Kodo 3.4.1 and Oracle JDBC 11.1.0.6?

    Hi,
    did anybody already try using Kodo 3.4.1 and Oracle JDBC driver 11.1.0.6?
    We have been able to use it by specifying:
    kodo.jdbc.DBDictionary=oracle(BatchLimit=1000)
    but it does not run very smoothly and we get for example the
    following exception (but not always).
    NestedThrowablesStackTrace:
    [migrate-data] java.lang.ArrayIndexOutOfBoundsException: -32193
    [migrate-data] at
    oracle.jdbc.driver.OraclePreparedStatement.setupBindBuffers(OraclePreparedS
    tatement.java:2677) [migrate-data] at
    oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedState
    ment.java:9270) [migrate-data] at
    oracle.jdbc.driver.OracleStatementWrapper.executeBatch(OracleStatementWrapp
    er.java:210) [migrate-data] at
    com.solarmetric.jdbc.DelegatingPreparedStatement.executeBatch(DelegatingPre
    paredStatement.java:325) [migrate-data] at
    com.solarmetric.jdbc.PoolConnection$PoolPreparedStatement.executeBatch(Pool
    Connection.java:375) [migrate-data] at
    com.solarmetric.jdbc.DelegatingPreparedStatement.executeBatch(DelegatingPre
    paredStatement.java:325) [migrate-data] at
    com.solarmetric.jdbc.DelegatingPreparedStatement.executeBatch(DelegatingPre
    paredStatement.java:325) [migrate-data] at
    com.solarmetric.jdbc.DelegatingPreparedStatement.executeBatch(DelegatingPre
    paredStatement.java:325)Any hints?
    Thanks,
    Werner

    Disabling SQL batching by specifying BatchLimit = 0 solved the
    problem temporarlyOf course this is not what we want, anybody else using this configuration?
    Werner

  • Error oracle.sql.* and oracle.jdbc.driver.* not found when using oracle as a database

    I am using oracle as database and weblogic 4.5. I have copied the classes12.zip file in lib directory of weblogic. I am getting the error that oracle.sql.* and oracle.jdbc.driver.* not found when i am importing these packages in a jsp file. what i need to do to import oracle driver packages?I put it in the classpath also.
    Please Advice!
    Thanks in advance
    AnuPama

    Hi Anupama,
    First of all I would be surprised if you would not like to use the connection pooling feature of weblogic (in which case you might not be needing the import the classes directly), and would like to open direct connections to your database. Anyways for doing that I would recommend you to check out the readme doc that ships
    along with the jdbc oracle (classes12.zip etc). I am giving an excerpt over here:
    These are a few simple things that you should do in your JDBC program:
    1. Import the necessary JDBC classes in your programs that use JDBC.
    For example:
    import java.sql.*;
    import java.math.*;
    2. Register the Oracle driver before before calling other JDBC APIs.
    (This is not needed if you are using the JDBC Server-side Internal
    Driver because registration is done automatically in the server.)
    To register the Oracle driver, make sure the following statement
    is executed at least once in your Java session:
    DriverManager.registerDriver(
    new oracle.jdbc.driver.OracleDriver());
    3. Open a connection to the database with the getConnection call.
    Different connection URLs should be used for different JDBC
    drivers. The following examples demonstrate the different URLs.
    For the JDBC OCI8 Driver:
    Connection conn = DriverManager.getConnection(
    "jdbc:oracle:oci8:@<database>",
    "scott", "tiger");
    where <database> is either an entry in tnsnames.ora or a SQL*net
    name-value pair.
    For the JDBC Thin Driver, or Server-side Thin Driver:
    Connection conn = DriverManager.getConnection(
    "jdbc:oracle:thin:@<database>",
    "scott", "tiger");
    where <database> is either a string of the form
    <host>:<port>:<sid> or a SQL*net name-value pair.
    For the JDBC Server-side Internal Driver:
    Connection conn = DriverManager.getConnection(
    "jdbc:oracle:kprb:");
    Note that the trailing ':' character is necessary. When you use
    the Server-side Internal Driver, you always connect to the
    database you are executing in. You can also do this:
    Connection conn
    = new oracle.jdbc.driver.OracleDriver().defaultConnection();
    Hope this helps,
    Thanks,
    Anupama wrote:
    I am using oracle as database and weblogic 4.5. I have copied the classes12.zip file in lib directory of weblogic. I am getting the error that oracle.sql.* and oracle.jdbc.driver.* not found when i am importing these packages in a jsp file. what i need to do to import oracle driver packages?I put it in the classpath also.
    Please Advice!
    Thanks in advance
    AnuPama--
    Apurb Kumar

  • Anyone successfully using WL 6.0 and oracle.jdbc.xa.client.OracleXADataSource?

    My final goal is to have two xa pools pointing to different db's and
    have them in the same user transaction and do a 2 phase commit. I
    can't get past connecting to a single xa datasource. I have "Grant
    Select on DBA_PENDING_TRANSACTIONS to public".
    My config.xml snippet:
    <JDBCConnectionPool
    Name="ModelXaPool"
    Targets="WebApp"
    URL="jdbc:oracle:thin:@SERVER1:1521:DB"
    DriverName="oracle.jdbc.xa.client.OracleXADataSource"
    InitialCapacity="2"
    MaxCapacity="10"
    CapacityIncrement="2"
    Properties="user=uid;password=pw"
    RefreshMinutes="10"
    />
    <JDBCTxDataSource
    EnableTwoPhaseCommit="true"
    JNDIName="ModelManagerTxDataSource"
    Name="ModelManagerTxDataSource"
    PoolName="ModelManagerXaPool"
    Targets="WebWORKS"
    />
    My code snippet:
    UserTransaction tx = msgCtx.getUserTransaction();
    tx.begin();
    java.sql.Connection conn =
    (DataSource)ctx.lookup("ModelManagerTxDataSource")).getConnection();
    Statement stmt = conn.createStatement();
    The connection seems to be gotten just fine. On the createStatement,
    I get the following exception.
    java.sql.SQLException: Internal error: Cannot obtain XAConnection
    Creation of XAConnection for pool ModelXaPool failed after
    waitSecs:298
    at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:772)
    at weblogic.jdbc.jta.Connection.getXAConn(Connection.java:130)
    at weblogic.jdbc.jta.Connection.createStatement(Connection.java:201)
    at weblogic.jdbc.rmi.internal.ConnectionImpl.createStatement(ConnectionImpl.java:71)
    at weblogic.jdbc.rmi.SerialConnection.createStatement(SerialConnection.java:42)
    Any suggestions/advice?
    Thanks,
    Dale

    Hi Dale,
    What version of Oracle are you using at least 8.1.7 is need to be able to
    use Oracle thin driver/XA. Also the JDBCConnectionPool and TxDataSource tags
    dont seem to match here. Both need to be targeted on to the same server. And
    the name of the pool in TxDataSource need to match the pool you have on the
    server.
    To setup oracle for XA you need to make sure this script is run on the
    server, initjvm.sql (It should be in your oracle installation rdbms scripts)
    and then grant select permission on dba_pending_transactions.
    Are you able to setup a connection pool with a non-XA driver?
    sree
    "Dale Bronk" <[email protected]> wrote in message
    news:[email protected]...
    My final goal is to have two xa pools pointing to different db's and
    have them in the same user transaction and do a 2 phase commit. I
    can't get past connecting to a single xa datasource. I have "Grant
    Select on DBA_PENDING_TRANSACTIONS to public".
    My config.xml snippet:
    <JDBCConnectionPool
    Name="ModelXaPool"
    Targets="WebApp"
    URL="jdbc:oracle:thin:@SERVER1:1521:DB"
    DriverName="oracle.jdbc.xa.client.OracleXADataSource"
    InitialCapacity="2"
    MaxCapacity="10"
    CapacityIncrement="2"
    Properties="user=uid;password=pw"
    RefreshMinutes="10"
    />
    <JDBCTxDataSource
    EnableTwoPhaseCommit="true"
    JNDIName="ModelManagerTxDataSource"
    Name="ModelManagerTxDataSource"
    PoolName="ModelManagerXaPool"
    Targets="WebWORKS"
    />
    My code snippet:
    UserTransaction tx = msgCtx.getUserTransaction();
    tx.begin();
    java.sql.Connection conn =
    (DataSource)ctx.lookup("ModelManagerTxDataSource")).getConnection();
    Statement stmt = conn.createStatement();
    The connection seems to be gotten just fine. On the createStatement,
    I get the following exception.
    java.sql.SQLException: Internal error: Cannot obtain XAConnection
    Creation of XAConnection for pool ModelXaPool failed after
    waitSecs:298
    atweblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:772)
    at weblogic.jdbc.jta.Connection.getXAConn(Connection.java:130)
    at weblogic.jdbc.jta.Connection.createStatement(Connection.java:201)
    atweblogic.jdbc.rmi.internal.ConnectionImpl.createStatement(ConnectionImpl.jav
    a:71)
    atweblogic.jdbc.rmi.SerialConnection.createStatement(SerialConnection.java:42)
    >
    Any suggestions/advice?
    Thanks,
    Dale

  • IE4 and Oracle JDBC

    Hi,
    I downloaded and installed Oracles JDBC drivers and tested
    them out using the sample programs that Oracle provided. Though
    the application I was able to connect and retrieve some rows
    without any problem. I then modefied the Java source for the
    applet and ran it through Sun's Appletviewer and was able to
    retrieve rows. I then tried to run the same applet through IE4
    and the applet started okay but I recieved the following:
    Loading JDBC driver oracle.jdbc.driver.OracleDriver
    Connecting to SMORA1
    cannot access "<This was my Oracle host name>"
    I'm running the applet of my PC and trying to connect to the
    Oracle host. I think I may of just answered my own question.
    But why would it work with Appletviewer??
    Thanks
    Dave
    null

    Dave:
    I am facing the same problem but not getting any answer. Could
    you let me know what solution did you implement to get it going.
    Thanks in advance,
    Raj.
    David Staelens (guest) wrote:
    : Hi,
    : I downloaded and installed Oracles JDBC drivers and tested
    : them out using the sample programs that Oracle provided.
    Though
    : the application I was able to connect and retrieve some rows
    : without any problem. I then modefied the Java source for the
    : applet and ran it through Sun's Appletviewer and was able to
    : retrieve rows. I then tried to run the same applet through
    IE4
    : and the applet started okay but I recieved the following:
    : Loading JDBC driver oracle.jdbc.driver.OracleDriver
    : Connecting to SMORA1
    : cannot access "<This was my Oracle host name>"
    : I'm running the applet of my PC and trying to connect to the
    : Oracle host. I think I may of just answered my own question.
    : But why would it work with Appletviewer??
    : Thanks
    : Dave
    null

  • Can I include MQSeires JMS XADataSource and Oracle JDBC XADataSource in one transaction?

              When I try to use a XADataSource (using Oracle 8.1.6 XA JDBC driver) to update
              a table in onMessage() of a MDB (Message Driven Bean) using container managed
              transaction, an exception occured like this:
              java.sql.SQLException: ORA-06550: ? 1 ?, ? 14 ???: PLS-00201: ??? 'JAVA_XA.XA_START'
              ????? ORA-06550: ? 1 ?, ? 8 ???: PL/SQL: Statement ignored
              at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114) at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
              at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:542) at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1311)
              at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:738 ) at
              oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.ja va:1313)
              at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.jav a:1232)
              at oracle.jdbc.driver.OracleStatement.doExecuteWithBatch(OracleStatement .java:1353)
              at oracle.jdbc.driver.OracleStatement.doExecute(OracleStatement.java:176 0) at
              oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStateme nt.java:1805)
              at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePrepar edStatement.java:322)
              at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStat ement.java:366)
              at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:10 2) at
              weblogic.transaction.internal.ServerResourceInfo.start(ServerResource Info.java:994)
              at weblogic.transaction.internal.ServerResourceInfo.xaStart(ServerResour ceInfo.java:947)
              at weblogic.transaction.internal.ServerResourceInfo.enlist(ServerResourc eInfo.java:206)
              at weblogic.transaction.internal.ServerTransactionImpl.enlistResource(Se rverTransactionImpl.java:316)
              at weblogic.jdbc.common.internal.ConnectionEnv.test(ConnectionEnv.java:6 51) at
              weblogic.common.internal.ResourceAllocator.reserve(ResourceAllocator. java:444)
              at weblogic.common.internal.ResourceAllocator.reserve(ResourceAllocator. java:379)
              at weblogic.common.internal.ResourceAllocator.reserveWaitSecs(ResourceAl locator.java:369)
              at weblogic.jdbc.common.internal.ConnectionPool.reserve(ConnectionPool.j ava:167)
              at weblogic.jdbc.common.internal.ConnectionPool.reserveWaitSecs(Connecti onPool.java:121)
              at weblogic.jdbc.jta.DataSource.getXAConnectionFromPool(DataSource.java: 861)
              at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:7 43) at
              weblogic.jdbc.jta.Connection.getXAConn(Connection.java:130) at weblogic.jdbc.jta.Connection.createStatement(Connection.java:201)
              at weblogic.jdbc.rmi.internal.ConnectionImpl.createStatement(ConnectionI mpl.java:71)
              at weblogic.jdbc.rmi.SerialConnection.createStatement(SerialConnection.j ava:42)
              at MDB.onMessage(MDB.java:46) at weblogic.ejb20.internal.MDListener.execute(MDListener.java:221)
              at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:175) at com.ibm.mq.jms.MQQueueReceiver.receiveAsync(MQQueueReceiver.java:640)
              at com.ibm.mq.jms.SessionAsyncHelper.run(SessionAsyncHelper.java:355) java.sql.SQLException:
              ORA-06550: ? 1 ?, ? 14 ???: PLS-00201: ??? 'JAVA_XA.XA_START' ????? ORA-06550:
              ? 1 ?, ? 8 ???: PL/SQL: Statement ignored
              at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114) at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
              at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:542) at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1311)
              at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:738 ) at
              oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.ja va:1313)
              at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.jav a:1232)
              at oracle.jdbc.driver.OracleStatement.doExecuteWithBatch(OracleStatement .java:1353)
              at oracle.jdbc.driver.OracleStatement.doExecute(OracleStatement.java:176 0) at
              oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStateme nt.java:1805)
              at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePrepar edStatement.java:322)
              at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStat ement.java:366)
              at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:10 2) at
              weblogic.jdbc.jta.DataSource.start(DataSource.java:324) at weblogic.transaction.internal.ServerResourceInfo.start(ServerResource
              Info.java:994) at weblogic.transaction.internal.ServerResourceInfo.xaStart(ServerResour
              ceInfo.java:947) at weblogic.transaction.internal.ServerResourceInfo.enlist(ServerResourc
              eInfo.java:206) at weblogic.transaction.internal.ServerTransactionImpl.enlistResource(Se
              rverTransactionImpl.java:316) at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:817)
              at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:7 88) at
              weblogic.jdbc.jta.Connection.getXAConn(Connection.java:130) at weblogic.jdbc.jta.Connection.createStatement(Connection.java:201)
              at weblogic.jdbc.rmi.internal.ConnectionImpl.createStatement(ConnectionI mpl.java:71)
              at weblogic.jdbc.rmi.SerialConnection.createStatement(SerialConnection.j ava:42)
              at MDB.onMessage(MDB.java:46) at weblogic.ejb20.internal.MDListener.execute(MDListener.java:221)
              at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:175) at com.ibm.mq.jms.MQQueueReceiver.receiveAsync(MQQueueReceiver.java:640)
              at com.ibm.mq.jms.SessionAsyncHelper.run(SessionAsyncHelper.java:355) java.sql.SQLException:
              XA error: XAER_RMERR : A resource manager error has occur ed in the transaction
              branch start() failed on resource 'jtaXAPool' null at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:822)
              at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:7 88) at
              weblogic.jdbc.jta.Connection.getXAConn(Connection.java:130) at weblogic.jdbc.jta.Connection.createStatement(Connection.java:201)
              at weblogic.jdbc.rmi.internal.ConnectionImpl.createStatement(ConnectionI mpl.java:71)
              at weblogic.jdbc.rmi.SerialConnection.createStatement(SerialConnection.j ava:42)
              at MDB.onMessage(MDB.java:46) at weblogic.ejb20.internal.MDListener.execute(MDListener.java:221)
              at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:175) at com.ibm.mq.jms.MQQueueReceiver.receiveAsync(MQQueueReceiver.java:640)
              at com.ibm.mq.jms.SessionAsyncHelper.run(SessionAsyncHelper.java:355)
              Does that mean WLS 6.0 SP1 can not include JMS XADataSource and JDBC XADataSource
              in one distributed transaction managed by container?
              

              It should work. Check out the documentation on our developer center for
              more information. Developer.BEA.com
              Michael Girdley
              BEA Systems
              Learning WebLogic? http://learnweblogic.com
              "Sam Ni" <[email protected]> wrote in message
              news:[email protected]...
              >
              > When I try to use a XADataSource (using Oracle 8.1.6 XA JDBC driver) to
              update
              > a table in onMessage() of a MDB (Message Driven Bean) using container
              managed
              > transaction, an exception occured like this:
              >
              > java.sql.SQLException: ORA-06550: ? 1 ?, ? 14 ???: PLS-00201: ???
              'JAVA_XA.XA_START'
              > ????? ORA-06550: ? 1 ?, ? 8 ???: PL/SQL: Statement ignored
              >
              > at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114) at
              oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
              > at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:542) at
              oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1311)
              > at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:738 )
              at
              > oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.ja
              va:1313)
              > at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.jav
              a:1232)
              > at oracle.jdbc.driver.OracleStatement.doExecuteWithBatch(OracleStatement
              .java:1353)
              > at oracle.jdbc.driver.OracleStatement.doExecute(OracleStatement.java:176
              0) at
              > oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStateme
              nt.java:1805)
              > at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePrepar
              edStatement.java:322)
              > at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStat
              ement.java:366)
              > at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:10
              2) at
              > weblogic.transaction.internal.ServerResourceInfo.start(ServerResource
              Info.java:994)
              > at weblogic.transaction.internal.ServerResourceInfo.xaStart(ServerResour
              ceInfo.java:947)
              > at weblogic.transaction.internal.ServerResourceInfo.enlist(ServerResourc
              eInfo.java:206)
              > at weblogic.transaction.internal.ServerTransactionImpl.enlistResource(Se
              rverTransactionImpl.java:316)
              > at weblogic.jdbc.common.internal.ConnectionEnv.test(ConnectionEnv.java:6
              51) at
              > weblogic.common.internal.ResourceAllocator.reserve(ResourceAllocator.
              java:444)
              > at weblogic.common.internal.ResourceAllocator.reserve(ResourceAllocator.
              java:379)
              > at weblogic.common.internal.ResourceAllocator.reserveWaitSecs(ResourceAl
              locator.java:369)
              > at weblogic.jdbc.common.internal.ConnectionPool.reserve(ConnectionPool.j
              ava:167)
              > at weblogic.jdbc.common.internal.ConnectionPool.reserveWaitSecs(Connecti
              onPool.java:121)
              > at weblogic.jdbc.jta.DataSource.getXAConnectionFromPool(DataSource.java:
              861)
              > at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:7
              43) at
              > weblogic.jdbc.jta.Connection.getXAConn(Connection.java:130) at
              weblogic.jdbc.jta.Connection.createStatement(Connection.java:201)
              > at weblogic.jdbc.rmi.internal.ConnectionImpl.createStatement(ConnectionI
              mpl.java:71)
              > at weblogic.jdbc.rmi.SerialConnection.createStatement(SerialConnection.j
              ava:42)
              > at MDB.onMessage(MDB.java:46) at
              weblogic.ejb20.internal.MDListener.execute(MDListener.java:221)
              > at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:175) at
              com.ibm.mq.jms.MQQueueReceiver.receiveAsync(MQQueueReceiver.java:640)
              >
              >
              > at com.ibm.mq.jms.SessionAsyncHelper.run(SessionAsyncHelper.java:355)
              java.sql.SQLException:
              > ORA-06550: ? 1 ?, ? 14 ???: PLS-00201: ??? 'JAVA_XA.XA_START' ?????
              ORA-06550:
              > ? 1 ?, ? 8 ???: PL/SQL: Statement ignored
              >
              > at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114) at
              oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
              > at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:542) at
              oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1311)
              > at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:738 )
              at
              > oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.ja
              va:1313)
              > at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.jav
              a:1232)
              > at oracle.jdbc.driver.OracleStatement.doExecuteWithBatch(OracleStatement
              .java:1353)
              > at oracle.jdbc.driver.OracleStatement.doExecute(OracleStatement.java:176
              0) at
              > oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStateme
              nt.java:1805)
              > at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePrepar
              edStatement.java:322)
              > at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStat
              ement.java:366)
              > at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:10
              2) at
              > weblogic.jdbc.jta.DataSource.start(DataSource.java:324) at
              weblogic.transaction.internal.ServerResourceInfo.start(ServerResource
              > Info.java:994) at
              weblogic.transaction.internal.ServerResourceInfo.xaStart(ServerResour
              > ceInfo.java:947) at
              weblogic.transaction.internal.ServerResourceInfo.enlist(ServerResourc
              > eInfo.java:206) at
              weblogic.transaction.internal.ServerTransactionImpl.enlistResource(Se
              > rverTransactionImpl.java:316) at
              weblogic.jdbc.jta.DataSource.enlist(DataSource.java:817)
              > at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:7
              88) at
              > weblogic.jdbc.jta.Connection.getXAConn(Connection.java:130) at
              weblogic.jdbc.jta.Connection.createStatement(Connection.java:201)
              > at weblogic.jdbc.rmi.internal.ConnectionImpl.createStatement(ConnectionI
              mpl.java:71)
              > at weblogic.jdbc.rmi.SerialConnection.createStatement(SerialConnection.j
              ava:42)
              > at MDB.onMessage(MDB.java:46) at
              weblogic.ejb20.internal.MDListener.execute(MDListener.java:221)
              > at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:175) at
              com.ibm.mq.jms.MQQueueReceiver.receiveAsync(MQQueueReceiver.java:640)
              >
              >
              > at com.ibm.mq.jms.SessionAsyncHelper.run(SessionAsyncHelper.java:355)
              java.sql.SQLException:
              > XA error: XAER_RMERR : A resource manager error has occur ed in the
              transaction
              > branch start() failed on resource 'jtaXAPool' null at
              weblogic.jdbc.jta.DataSource.enlist(DataSource.java:822)
              > at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:7
              88) at
              > weblogic.jdbc.jta.Connection.getXAConn(Connection.java:130) at
              weblogic.jdbc.jta.Connection.createStatement(Connection.java:201)
              > at weblogic.jdbc.rmi.internal.ConnectionImpl.createStatement(ConnectionI
              mpl.java:71)
              > at weblogic.jdbc.rmi.SerialConnection.createStatement(SerialConnection.j
              ava:42)
              > at MDB.onMessage(MDB.java:46) at
              weblogic.ejb20.internal.MDListener.execute(MDListener.java:221)
              > at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:175) at
              com.ibm.mq.jms.MQQueueReceiver.receiveAsync(MQQueueReceiver.java:640)
              >
              >
              > at com.ibm.mq.jms.SessionAsyncHelper.run(SessionAsyncHelper.java:355)
              >
              >
              > Does that mean WLS 6.0 SP1 can not include JMS XADataSource and JDBC
              XADataSource
              > in one distributed transaction managed by container?
              >
              >
              

  • PI 7.1 and Oracle JDBC driver: missing com.sap.aii.adapter.lib.sda

    Hello,
    I want to deploy the JDBC driver for Oracle databases as described in OSS 1138877 on a brand-new PI7.1 (SP06 Stack) installation. Unfortunately, I can't find com.sap.aii.adapter.lib.sda on the system, so I can't add the ojdbc14.jar file and deplay it using JSPM.
    Where can I get it from?
    Thank you and best regards,
    Herwig

    hey,
         The JDBC driver installation is different for PI 7.1.
    The dowload/modify/deploy .sap.aii.adapter.lib.sda method was used in the earlier versions.(mentioned in the How to guides)
    Look at the SAP documentation below -
    http://help.sap.com/saphelp_nwpi71/helpdata/en/cf/128a42f802a01ae10000000a155106/frameset.htm
    Arvind R

  • Multithreaded clients and Oracle JDBC-drivers?

    Are the thin and OCI8 drivers for Oracle multithreaded? (I know they're thread safe)
    I.e. Can many threads share the same Connection object (and statement objects) to do their requests without the requests being serialized to the DB?
    Sun's javadoc of package java.sql says:
    We require that all operations on all the java.sql objects be multi-thread safe and able to cope correctly with having several threads simultaneously calling the same object.
    Some drivers may allow more concurrent execution than others. Developers can assume fully concurrent execution; if the driver requires some form of synchronization, it will provide it. The only difference visible to the developer will be that applications will run with reduced concurrency.
    For example, two Statements on the same Connection can be executed concurrently and their ResultSets can be processed concurrently (from the perspective of the developer). Some drivers will provide this full concurrency. Others may execute one statement and wait until it completes before sending the next.
    One specific use of multi-threading is to cancel a long running statement. This is done by using one thread to execute the statement and another to cancel it with its Statement.cancel() method.
    Restated again for Oracle; Will threads run concurrently when using the same connection and statements, or will the calls be serialized?

    In the connection pool, I specified:
    user
    password
    url
    In the deployment tool (Sun Java Appl. Server 8 BE Update 1), I specified the "Resource Reference" for the EJB. This leads to the following entries in sun-ejb-jar.xml:
    <res-ref-name>jdbc/pdisasdb</res-ref-name>        
       <jndi-name>jdbc/pdisasdb</jndi-name>        
          <default-resource-principal>         
             <name>myname</name>          
             <password>geheim</password>        
          </default-resource-principal> 
    </resource-ref> The strange thing is, that now it works without this entry - but I am not gaga, yesterday it doesnt...

  • Jdeveloper 11g: how to change the extension library Oracle JDBC

    Hello
    We use JDeveloper 11g for our desktop (swing) projects. When I debug the project in IDE, the classpath includes this jar: C:\Oracle\jdevstudio1117\oracle_common\modules\oracle.jdbc_11.1.1\ojdbc6dms.jar
    The ojdbc6dms.jar is in Oracle JDBC extension library. We actually want to use ojdbc14dms.jar as our jdbc library jar. I exclude the ojdbc6dms.jar in the project classpath setting and add a user library for ojdbc14dms.jar. When I run the project, the IDE still use ojdbc6dms.jar in the classpath. I try to use "Manage Libraries" under "Tools" menu to change the jar file in Oracle JDBC extension library, but it cannot be changed.
    Can I ask how to change ojdbc6dms.jar to ojdbc14dms.jar in Oracle JDBC? Or, how can I let the IDE not use ojdbc6dms.jar when I run the project? Thank you
    Leaf

    Replace the ojdbc6dms.jar with ojdbc14dms.jar in C:\Oracle\jdevstudio1117\oracle_common\modules\oracle.jdbc_11.1.1
    The ojdbc14dms.jar may be required to be renamed to ojdbc6dms.jar in the C:\Oracle\jdevstudio1117\oracle_common\modules\oracle.jdbc_11.1.1 as the pre-configured settings are for ojdbc6dms.jar.
    Edited by: dvohra21 on Jun 3, 2013 5:47 AM

  • How to avoid oracle.jdbc.driver.OracleConnection using

    i'am new in Java but recently i've got a project on support.
    Problem:
    solution worked on jvm 1.4, now on 1.7.
    Respectively, class oracle.jdbc.driver.OracleConnection has been used.
    Now I need class oracle.jdbc.OracleConnection to use CLOB.createTemporary() but...I can't.
    According to the docs, it's enough to replace in code and config files one class declaration on another. But NO. I replaced all of them in all config files and anyway, there was only oracle.jdbc.driver.OracleConnection has been created. (there is no explicit declaration of connection type in code, everything is configured in config files)
    Project uses marven, mybatis-3.1.1. Database: oracle 9
    Driver: ojdbc14-9.2.0.5.jar contains both classes: both oracle.jdbc.driver.OracleConnection (for backward compatibility) and oracle.jdbc.OracleConnection.
    The matter is what should i do to use second one instead of first one.
    May be there is some java cache? I do not know...
    Anybody knows?

    Now I need class oracle.jdbc.OracleConnection to use CLOB.createTemporary() but...I can't.
    Why not? You have to explain, in detail, WHAT you are trying and WHY you say you "can't" do it.
    According to the docs, it's enough to replace in code and config files one class declaration on another.
    That is correct - this IS all that is required. Replace ALL references to 'oracle.jdbc.driver' in your code.
    But NO. I replaced all of them in all config files and anyway, there was only oracle.jdbc.driver.OracleConnection has been created. (there is no explicit declaration of connection type in code, everything is configured in config files)
    We can't SEE what 'config' information you say you changed. It is what is in the CODE that matters, not what is in a config file.
    If the 'oracle.jdbc.driver' package is being imported by your code and a reference to 'Connection' is made Java will use it from the first package that it finds the class in.
    You are using an ANCIENT jdbc jar file. That doc you linked to WARNS you that you should upgrade and that doc is over ten years old.
    Remove that old jdbc jar file and use the current driver. Also remove references to the old package and replace them with references to the new package.
    With code and jars that are that old you can expect to have problems trying to use additional features, especially extensions. I would be surprised if you didn't have other issues as well.
    You need to perform code review to find all of the references that need to be corrected.

  • Oracle jdbc driver problems in netbeans 5.5

    need help again....i'm experience a problem. the problems are :
    i connect from netbeans 5.5 to oracle database express client 10g using jdbc driver ojdbc14.jar. the connection succeded (all the tables appears and i even can view the data). but when i trying to bind data to a drop down list component (with right click to the dropdown list component and then bind data), the dataprovider of that table appear in red color and there's no field appears in that. i'm so confused? i already add the ojdbc14.jar driver to the following path :
    1. i create a new class library in netbeans with consist of that driver,
    then added to my project (right click in my project then add library).
    2. then i added the ojdbc14.jar driver to my tomcats lib at "C:\Program
    Files\netbeans-5.5\enterprise3\apache-tomcat-5.5.17\common\lib".
    Is there any additional settings in using oracle jdbc driver? Does anyone knows? thanks a lot for the answers...
    Message was edited by:
    darma_sadha

    Hi!
    I'm using NetBeans 6.5 and I'm having some troubles to connect.
    The steps I've made:
    - Create the connection pool in Glassfish, nothing special, just standard parameters (Based on javax.sql.DataSource and including URL, Username and Password).
    - Create the JDBC resource associated with that connection pool,let's say jdbc/test.
    Now in NetBeans I register the driver:
    - New driver -> Find the ojdbc14.jar and from the options that I can choose it shows: oracle.jdbc.OracleDriver and oracle.jdbc.driver.OracleDriver.
    If i choose without +.driver+ I got the thin drivers (the ones i want) and if i chosse the one with the other one I got the OCI drivers. So I choose the first option oracle.jdbc.OracleDriver
    - Then I go to my project and click New -> Entity Classes from Database and from Datasource I select jdbc/test and it shows the following error message:
    Unable to find the driver oracle.jdbc.driver.OracleDriver. Please register this driver in the Databases.
    I can fix it if while registering the ojdbc14.jar I select the second option (*oracle.jdbc.driver.OracleDriver*) but with this option I need to specity the connection to use OCI instead of the desired thin driver.
    I hope you'll understand and help me somehow
    Edited by: KILE on Oct 10, 2008 2:26 AM

  • Oracle JDBC Packages

    I'm trying to write a Java program that will access data in an Oracle 10g Express Edition database, but it needs 2 JDBC packages, oracle.sql and oracle.jdbc. I had been using Eclipse for my development, but I just downloaded JDeveloper, thinking that JDeveloper would include these packages. It apparently doesn't. Where can I find these packages so that I can include them in one of my (3) IDEs? This is very frustrating, to say the least... Thanks for any help that anyone can give me. My e-mail address is [email protected]

    import java.sql.*;
    class Conn {
      public static void main (String args []) throws SQLException
           try {
                 Class.forName ("oracle.jdbc.driver.OracleDriver");
           } catch (ClassNotFoundException e) {
                 e.printStackTrace();
            Connection conn = DriverManager.getConnection
                ("jdbc:oracle:thin:@localhost:1521:orcl", "scott", "tiger");
                                // @machineName:port:SID,   userid,  password
            Statement stmt = conn.createStatement();
            ResultSet rset = stmt.executeQuery("select BANNER from SYS.V_$VERSION");
            while (rset.next())
                  System.out.println (rset.getString(1));   // Print col 1
            stmt.close();
    }

  • Oracle JDBC 2.0 extensions

    Hi,
    We are currently using Oracle 8i with the Oracle JDBC driver v.8.1.7 found in classes12.zip. I've seen mention on this board of an OracleRowSet and OracleCachedRowSet. Where are these classes located because they aren't included in my jar? Can I have a link to a place to download them? Are the javax.sql JDBC 2.0 extensions even implemented with this version of the Oracle drivers? I don't see anything about an OracleRowSet in the docs that come with the driver.
    Also, are these classes meant to support large resultsets? We have a need to process large numbers of results (somewhere in the neighborhood of 400,000 rows). We can't limit this amount of rows or run the query a second time as the first run of the query could take hours anyway. We're currently using a caching solution from BEA but are looking into Oracle's RowSet/CachedRowSet implementation.
    Thanks for any help!
    K Lewis

    you need ocrs12.zip for RowSet and cached RowSet but i think these are supported only in Oracle9i Database R1 and up
    Kuassi
    Hi,
    We are currently using Oracle 8i with the Oracle JDBC driver v.8.1.7 found in classes12.zip. I've seen mention on this board of an OracleRowSet and OracleCachedRowSet. Where are these classes located because they aren't included in my jar? Can I have a link to a place to download them? Are the javax.sql JDBC 2.0 extensions even implemented with this version of the Oracle drivers? I don't see anything about an OracleRowSet in the docs that come with the driver.
    Also, are these classes meant to support large resultsets? We have a need to process large numbers of results (somewhere in the neighborhood of 400,000 rows). We can't limit this amount of rows or run the query a second time as the first run of the query could take hours anyway. We're currently using a caching solution from BEA but are looking into Oracle's RowSet/CachedRowSet implementation.
    Thanks for any help!
    K Lewis

  • Difference between oracle and BEA JDBC Drivers

    One of our application plan to move from BEA JDBC drives to Oracle drivers.
    We use Weblogic 9.2 as application server and Oracle 10g as the database.
    Questions
    =======
    1. What is the basic difference between these drivers and how do we decide which one to use.
    2. What can be the impact of moving to Oracle drives from BEA on the overall application...?
    3. Other than change in the jdbc.datasource.url = jdbc:oracle:thin:@, do we need to take anything else into consideration.
    Pls. let me know in case any further details are required.
    Thanks in advance.

    "1. What is the basic difference between these drivers and how do we decide which one to use."
    They are totally different products made independently by different companies.
    "2. What can be the impact of moving to Oracle drives from BEA on the overall application...?"
    As long as your application uses standard JDBC APIs, the impacts will be minimized, and
    unpredictable, some running faster, some slower... Any bug list for one driver will be
    different than for the other. If you use any driver-specific extension APIs, they won't
    be in the other driver.
    "3. Other than change in the jdbc.datasource.url = jdbc:oracle:thin:@, do we need to take anything else into consideration."
    Also changing the diver/datasource class name, and reviewing any arguments/driver properties.
    Property names and functions are usually driver-specific.
    Joe

Maybe you are looking for

  • Service contract from outline agreements

    Hi MM gurus, my requirement is tht i should send a Machine for repair to an outside vendor..the requirement is triggered from PM-Order.. i should make a contract with tht vendor say for a valu of 10000/-..could anyone suggests me hw can i map this,,,

  • The Weblogic Server not start.

    Weblogic 10.3.6.0 For SOA 11.1.1.6 When I start the weblogic server it does not start, the message that the server is running is not displayed. Can anyone help me? $ pwd /app/oracle/product/fwm11g/user_projects/domains/fwm_domain/bin $ nohup ./startW

  • Can't get wireless internet ... Still.

    *Issue: Macbook can't connect to internet through wireless network.* I have seen numerous identical issues posted online with no solutions?           1. All other computers (mac and pc) Ipod touch, ps3 still work on the wireless network      2. The m

  • Interactive Syllabus question

    If I create an interactive syllabus in InDesign, will my students need InDesign to use it?

  • A problem in calling a subcontroller

    I try to use the model class and call a subcontroller class to display data in another view by using the following code. <b>In the do_init of main controller</b> * Create the model of this class l_model = create_model( model_id = c_model_id class_nam