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

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)

  • 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

  • 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.

  • How to get comparable Oracle JDBC performance using Java 1.4 vs 1.1.7?

    Our application makes extensive use of JDBC to access an Oracle database. We wrote it a number of years ago using java 1.1.7 and we have been unable to move to new versions of java because of the performance degradation.
    I traced the problem to JDBC calls. I can reproduce the problem using a simple program that simply connects to the database, executes a simple query and then reads the data. The same program running under java 1.4 is about 60% slower than under java 1.1.7. The query is about 80% slower and getting the data is about 150% slower!
    The program is attached below. Note, I run the steps twice as the first time the times are much larger which I attribute to java doing some initializations. So the second set of values I think are more representative of the actual performance in our application where there are numerous accesses to the database. Specifically, I focus on step 4 which is the execute query command and step 5 which is the data retrieval step. The table being read has 4 columns with 170 tuples in it.
    Here are the timings I get when I run this on a Sparc Ultra 5 running
    SunOs 5.8 using an Oracle database running 8.1.7:
                     java 1.1.7  java 1.4
            overall:    2.1s         3.5s
            step 1:     30           200
            step 2:    886          2009
            step 3:      2             2
            step 4:      9            17
            step 5:    122           187
            step 6:      1             1
            step 1:      0             0
            step 2:    203           161
            step 3:      0             1
            step 4:      8            15   <-   87% slower
            step 5:     48           117   <-  143% slower
            step 6:      1             2I find the same poor performance from java versions 1.2 and 1.3.
    I tried using DataDirect's type 4 JDBC driver which gives a little better performance but overall it is still much slower than using java 1.1.7.
    Why do the newer versions of java have such poor performance when using JDBC?
    What can be done so that we can have performance similar to java 1.1.7
    using java 1.4?
    ========================================================================
    import java.util.*;
    import java.io.*;
    import java.sql.*;
    public class test12 {
        public static void main(String args[]) {
            try {
                    long time1 = System.currentTimeMillis();
    /* step 1 */  DriverManager.registerDriver(
                        new oracle.jdbc.driver.OracleDriver());
                    long time2 = System.currentTimeMillis();
    /* step 2 */  Connection conn = DriverManager.getConnection (
                  "jdbc:oracle:thin:@dbserver1:1521:db1","user1","passwd1");
                    long time3 = System.currentTimeMillis();
    /* step 3 */  Statement stmt = conn.createStatement();
                    long time4 = System.currentTimeMillis();
    /* step 4 */  ResultSet rs = stmt.executeQuery("select * from table1");
                    long time5 = System.currentTimeMillis();
    /* step 5 */  while( rs.next() ) {
                      int message_num = rs.getInt(1);
                      String message = rs.getString(2);
                    long time6 = System.currentTimeMillis();
    /* step 6 */  rs.close(); stmt.close();
                    long time7 = System.currentTimeMillis();
                System.out.println("step 1: " + (time2 - time1) );
                System.out.println("step 2: " + (time3 - time2) );
                System.out.println("step 3: " + (time4 - time3) );
                System.out.println("step 4: " + (time5 - time4) );
                System.out.println("step 5: " + (time6 - time5) );
                System.out.println("step 6: " + (time7 - time6) );
                System.out.flush();
            } catch ( Exception e ) {
                System.out.println( "got exception: " + e.getMessage() );
            ... repeat the same 6 steps again...
    }

    If I run my sample program with the -server option, it
    takes a lot longer (6.8s vs 3.5s).Which has to be expected, as the -server option optimizes for long running programs - so it shoudl go with my second suggestion, more below...
    I am not certain what you mean by "just let the jvm
    running". Our users issue a command (in Unix) which
    invokes one of our java programs to access or update
    data in a database. I think what you are suggesting
    would require that I rewrite our application to have a
    java program always running on the users workstation
    and to also rewrite our
    commands (over a hundred) to some how pass data and
    receive data with this new server java program. That
    does not seem a very reasonable just to move to a new
    version of java. Or are you suggesting something
    else?No I was just suggestion what you descript. But if this is not an option, then maybe you should merge your java-programs to C or another native language. Or you could try the IBM-JDK with the -faststart (or similar) option. If thew Unix you mention is AIX, then there would be the option of a resetable-vm. But I cannot say if this VM would solve your problem. Java is definitly not good for applications which only issue some unqiue commands because the hotspot-compiler can not be efficiently used there. You can only try to get 1.1.7 performance by experimenting with vm-parameters (execute java -X).

  • Error while registering Oracle JDBC Diagnosability MBean

    Hi All,
    I get the following error (pasted at the end)when trying to use the OracleDriver class to create connections.
    I am using JDeveloper11g-11.1.1.2.0, and
    JDeveloper11g-11.1.1.2.0/wlserver_10.3/server/ext/jdbc/oracle/11g/ojdbc6.jar.
    I read other posts with similar errors; the recommendation was to update the jar to the latest patch. But that still does not seem to work.
    Any help/pointers appreciated.
    Thanks
    Meera
    ------------ Error trace ----------------------------------------------------
    SEVERE: Error while registering Oracle JDBC Diagnosability MBean.
    java.security.AccessControlException: access denied (javax.management.MBeanTrustPermission register)
         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
         at java.lang.SecurityManager.checkPermission(SecurityManager.java:568)
         at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.checkMBeanTrustPermission(DefaultMBeanServerInterceptor.java:1824)
         at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:310)
         at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:482)
         at oracle.jdbc.driver.OracleDriver.registerMBeans(OracleDriver.java:345)
         at oracle.jdbc.driver.OracleDriver$1.run(OracleDriver.java:197)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.jdbc.driver.OracleDriver.<clinit>(OracleDriver.java:193)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:169)
         at oracle.communications.brm.pdc.server.transfomation.CrossReferenceDBConnectionObj.initializeConnection(Unknown Source)
         at oracle.communications.brm.pdc.server.transfomation.CrossReferenceHandler.<init>(Unknown Source)
         at oracle.communications.brm.pdc.server.transfomation.RRE_TransformationEngine.createWorkItemProcessors(Unknown Source)
         at oracle.communications.brm.pdc.server.junit.RRE_TransformationEngineTests.testCreateWorkItemProcessors(Unknown Source)
         at oracle.communications.brm.pdc.server.junit.RRE_TransformationEngineTests.testMain(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
         at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
         at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
         at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
         at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
         at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:73)
         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46)
         at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
         at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
         at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
         at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
         at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
         at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
         at org.junit.runners.Suite.runChild(Suite.java:115)
         at org.junit.runners.Suite.runChild(Suite.java:23)
         at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
         at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
         at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
         at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
         at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
         at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
         at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:39)
         at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:421)
         at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:912)
         at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:766)

    Hi,
    did you enable the permission at the jvm level?
    its' done by adding the following lines to your java.policy file under <JRE_HOME>/lib/security
    grant {
    // JMX Java Management eXtensions
    permission javax.management.MBeanTrustPermission "register";
    ciao,
    Giovanni
    P.S. This solution was taken from http://forums.sun.com/thread.jspa?threadID=491124

  • Use of oracle.jdbc.driver now deprecated.

    Hi all,
    Just thought of sharing this note with us.,(if its new ..)
    http://otn.oracle.com/docs/products/oracle9i/doc_library/901_doc/java.901/a90211/overvw.htm#1008871
    Extract ...,
    Beginning in Oracle9i, the Oracle extensions to JDBC are captured in the package oracle.jdbc. This package contains classes and interfaces that specify the
    Oracle extensions in a manner similar to the way the classes and interfaces in java.sql specify the public JDBC API.
    Your code should use the package oracle.jdbc instead of the package oracle.jdbc.driver used in earlier versions of Oracle. Use of the package
    oracle.jdbc.driver is now deprecated, but will continue to be supported for backwards compatibility.
    All that is required to covert your code is to replace "oracle.jdbc.driver" with "oracle.jdbc" in the source and recompile. This cannot be done piece-wise.
    You must convert all classes and interfaces that are referenced by an application. Conversion is not required, but is highly recommended. Future releases of Oracle
    may have features that are incompatible with use of the package oracle.jdbc.driver.
    The purpose of this change is to enable the Oracle JDBC drivers to have multiple implementations. In all releases up to and including Oracle9i, all of the Oracle
    JDBC drivers have used the same top level implementation classes, the classes in the package oracle.jdbc.driver. By converting your code to use
    oracle.jdbc, you will be able to take advantage of future enhancements that use different implementation classes. There are no such enhancements in Oracle9i, but
    there are plans for such enhancements in the future.
    Regards
    Elango.

    The two main things that would have to change
    - driver : com.microsoft.sqlserver.jdbc.SQLServerDriver
    - url: jdbc:microsoft:sqlserver://localhost:1433
    It may be that this page will help you
    http://msdn.microsoft.com/data/learning/jdbc/
    You also need to make sure that the files Msbase.jar , Msutil.jar and Mssqlserver.jar are all available in the "classpath"
    For a web app, that means these files should be in the WEB-INF/lib directory.
    Good luck,
    evnafets

  • Java.io.NotSerializableException: oracle.jdbc.driver.T4CConnection

    Hi,
    I am using weblogic 9.2 on windows. I have the data source configured(Oracle 9.2)
    I am getting the following exception when I try to create temporaryBlob -
    BLOB blob = BLOB.createTemporary(conn, false,
                        BLOB.DURATION_SESSION);
    Exception messages ------
    Exception in thread "main" weblogic.rmi.extensions.RemoteRuntimeException: Unexpected Exception
         at weblogic.jdbc.rmi.internal.ConnectionImpl_weblogic_jdbc_wrapper_PoolConnection_oracle_jdbc_driver_T4CConnection_920_WLStub.physicalConnectionWithin(Unknown Source)
         at weblogic.jdbc.rmi.SerialConnection_weblogic_jdbc_rmi_internal_ConnectionImpl_weblogic_jdbc_wrapper_PoolConnection_oracle_jdbc_driver_T4CConnection_920_WLStub.physicalConnectionWithin(Unknown Source)
         at oracle.sql.BLOB.createTemporary(BLOB.java:587)
         at com.hp.nuoss.fm.cs.test.SessionBeanClient.testInsertBLOBData(SessionBeanClient.java:109)
         at com.hp.nuoss.fm.cs.test.SessionBeanClient.main(SessionBeanClient.java:154)
    Caused by: java.rmi.MarshalException: error marshalling return; nested exception is:
         java.io.NotSerializableException: oracle.jdbc.driver.T4CConnection
         at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:195)
         at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:224)
         ... 5 more
    Caused by: java.io.NotSerializableException: oracle.jdbc.driver.T4CConnection
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1075)
         at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)
         at weblogic.rjvm.MsgAbbrevOutputStream.writeObject(MsgAbbrevOutputStream.java:614)
         at weblogic.utils.io.ChunkedObjectOutputStream.writeObject(ChunkedObjectOutputStream.java:73)
         at weblogic.jdbc.rmi.internal.ConnectionImpl_weblogic_jdbc_wrapper_PoolConnection_oracle_jdbc_driver_T4CConnection_WLSkel.internalInvoke1(Unknown Source)
         at weblogic.jdbc.rmi.internal.ConnectionImpl_weblogic_jdbc_wrapper_PoolConnection_oracle_jdbc_driver_T4CConnection_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:517)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:407)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:403)
         at weblogic.rmi.internal.BasicServerRef.access$300(BasicServerRef.java:56)
         at weblogic.rmi.internal.BasicServerRef$BasicExecuteRequest.run(BasicServerRef.java:934)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)

    Someone else had this same problem and they seem to have solved it:
    http://forum.java.sun.com/thread.jspa?threadID=5105589&messageID=9363332
    I guess SessionBean1 is not serializable perhaps because it doesn't implement Serializable, and the writeObject method in StandardSession is trying to write it to disk (trying to serialize it).
    Try changing SessionBean 1 to
    public class SessionBean1 implements Serializable{
    }

  • 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.

  • Parameters on Oracle JDBC URL

    I wonder if anyone can help.
    I am writing a Java class which uses a JDBC PreparedStatement object to call a stored procedure on an Oracle database.
    To create the PreparedStatement object I use the prepareStatement method of the Connection object.
    I do not create the Connection object - this is important - it is passed into my method by another piece of code I cannot change.
    I need to specify some connection properties - specifically 'SetBigStringTryClob'. All the documentation I can find says that properties such as this can be passed to the Connection when it is created via a Properties object like this:
    // Load the database details into the variables.
    String url = "jdbc:oracle:thin:@localhost:1521:orcl";
    String user = "scott";String password = "tiger";
    // Create the properties object that holds all database details
    Properties props = new Properties();
    props.put("user", user );
    props.put("password", password);
    props.put("SetBigStringTryClob", "true");
    // Load the Oracle JDBC driver class.
    DriverManager.registerDriver(new OracleDriver());
    // Get the database connection
    Connection conn = DriverManager.getConnection( this.url, this.props );
    I cant do this as I dont create the Connection object. What I can do is specify the URL, so I'm thinking I should be able to specify my connection properities as url parameters - but I cant get it to work and I cant find anything anywhere that tells me how to do it.
    Any ideas?
    Alternatively I'm thinking that maybe there is a method of Connection where I can specify these properties - essentially after its been created - but again, I cant find anything
    Any help with this would be very much appreciated;
    Cheers
    Nathan

    Can you use the 11g drivers?
    See http://download.oracle.com/docs/cd/B28359_01/java.111/b31224/oralob.htm#CHDGJJDD
    Specifically the Input section
    Otherwise, is there any reason not to use the Oracle specific extensions? i.e. setStringForClob()

  • Couldnt load database driver: oracle.jdbc.driver.OracleDriver

    Hi,
    I could appreciate some help here.
    I have saved my classes12.zip and nls_charset12.zip in my c:\work\WebDev and I have added this to my classpath. But when I run my servlet, I still get the error of "Couldnt load database driver: oracle.jdbc.driver.OracleDriver"
    I also tried using jar files but still got the same error.
    Any sggestions to solve this?
    Thanks!!

    If it is Tomcat, extract the classes12.zip and place
    in the tomcat-home\common\classes folder.
    I am rather certain that it does not need to be extracted. I am also rather certain that the documentation for Tomcat points out the correct way to install it (which includes changing the extension from zip to jar.)

  • Sign oracle jdbc.jar?

    I have a program can be launched from webstart or applet.
    The client need to run a jdbc to a Oracle,...
    So i need to send the jdbc jar to client. But webstart only accept a signed jar to be able to connect to a database.
    My question is, Can I sign the pracle jdbc jar by my certificate.
    If I do that, where it break the distribution license of Oracle jdbc jar.If so, any legal way to do it?
    Any one have simialr experence?
    But if it is not signed, my application will simple can not run. (Oraclejar is not sigend them, so can't use extension either)
    Thanks

    Just unjar the oracle jar and sign it when you jar it back up. I've had to do it with several jars besides the oracle one.

  • Oracle JDBC driver does not handle Java empty strings correctly

    If you store a Java empty string in a VARCHAR column, then try to retrieve it,
    you get back a null.
    Can someone from Oracle JDBC development
    explain why this is not a bug? An empty
    string is not the same as a null.

    Hello!
    Although all together different, but DATE type also behaves same way.
    inserting createdate = NULL in database returns you blank on select query
    inserting createdate= '' returns null on select. Correct me if i am wrong.
    prity
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Nagaraj Govindaraj ([email protected]):
    If you store a Java empty string in a VARCHAR column, then try to retrieve it,
    you get back a null.
    Can someone from Oracle JDBC development
    explain why this is not a bug? An empty
    string is not the same as a null.<HR></BLOCKQUOTE>
    null

  • A sign Applet unable to load "oracle.jdbc.OracleDriver" class

    hi,
    i am chiranjit , i am now working in a web based ERP. where i am using a signed applet which unable to load "oracle.jdbc.OracleDriver" class but it easily loading "sun.jdbc.odbc.JdbcOdbcDriver", i am also giving my code:
    import java.sql.*;
    import java.math.*;
    import java.io.*;
    import java.awt.*;
    class JdbcTest extends Applet{
    public static void main (String args[]) throws SQLException {
    // Load Oracle driver
    DriverManager.registerDriver (new oracle.jdbc.OracleDriver());
    // Connect to the local database
    Connection conn =
    DriverManager.getConnection
    ("jdbc:oracle:thin:@192.168.16.7:1521:kris",
    "plsql", "oracle");
    // Query the employee names
    Statement stmt = conn.createStatement ();
    ResultSet rset = stmt.executeQuery ("SELECT FIRST_NAME FROM
    AUTHORS");
    // Print the name out
    while (rset.next ())
    System.out.println (rset.getString (1));
    // Close the result set, statement, and the connection
    rset.close();
    stmt.close();
    conn.close();
    }

    Hint: The sun.jdbc.odbc.JdbcOdbcDriver is available in any JRE distribution. The Oracle driver is not.

  • Unable to load oracle.jdbc.driver.OracleDriver class

    i want to connect my java application with oracle database but i m getting an error -"class not found exception oracle.jdbc.driver.OracleDriver " which is written in Class.forName() to register the driver for DriverManager.
    plz help me..

    This is an old class, not included with the JDK anymore. It was made obsolete by
    DataSource which is a connection pool and not a single connection.

Maybe you are looking for

  • Large file takes long time to open

    I'm not an Illustrator user.  I work in IT.  One of our Illustrator users is complaining that it takes about 10 to 15 minutes to open a 500MB file.  She has the latest hardware and 4 GBs of RAM on Windows 7.  She is on the latest version of CS5.  I j

  • Info Package in Process Chain taking long time

    Dear All, Info Package in Process Chain having 0 records is taking 1 hr 5 mins to complete. Time out time is set to 10 mins. Does any one of you know the reason why it is happening like this? Regards.

  • INVOICE W R TO GR / PO WITH BROKERAGE CONDITION

    HELLO Experts.. here is the issue.. i am working in hosiery industry. while i m making a contract for my YARN material . i have to do the contract through one broker and for that i have to pay him. suppose my material is X001, vendor is Y and broker

  • How do you unblock a plug in

    every time i try to watch a video on my mac i get a blank screen with a bar stating "blocked plug in" how do i fix this?

  • Can you take a photograph and add a caption and then email for business use?

    I want to be able to utilize my ipad in the followin manner: take a photo of a construction condition, write a caption under the photo or several photos adn then email to office so they can format and send out to contractor. I also want to create a r