Horrible performance with Oracle JDBC

Hi All,
I've been running into a problem with Oracle's JDBC driver it looks like. Queries are taking about 1 - 2 seconds to run, when they should take around 100 ms or less. Even "select sysdate from dual" takes 1.5 seconds or so.
I am using connection pooling (Both C3P0 and Apache DBCP seem to yield about the same results). I have tried a few different Oracle drivers (the 10g ones seem to be the fastest). I'm using the Thin Client.
I'm pretty much out of ideas at this point, and was wondering if anyone else had run into similar problems and could offer any advice.
Thanks.

Is this a general error?Do you experience this problem in a specific workstation or generally?Do you have a quick response using sqlplus? Have you checked that the delay is during query execution?There may be a chance that you don't get immediately a connection from the pool.

Similar Messages

  • Horrible performance with JDK 1.3.1!

    There is something very weird going on with Solaris (SPARC) JDK 1.3.1
    Hotspot Server jvm. We have an existing application which gets a large
    resultset back from the database, iterates over it and populates two int[]
    arrays.
    The operation iterates thru a 200,000 row resultset, which has three
    interger columns.
    Here are the performance numbers for various jdk (hotspot 2.0) combinations:
    Using Solaris JDK1.2.2_05a with the jit: 3 seconds
    Using Solaris JDK1.3.0 -server: <3 seconds
    Using Windows JDK1.3.1 -server: <3 seconds
    Using Solaris JDK1.3.1 -client: 7 seconds
    Using Solaris JDK1.3.1 -server: 3 MINUTES!
    As you can see the solaris 1.3.1 -server is having horrible performance, 60X
    worse than jdk1.3.0 -server and 1.2.2_05a with jit. I thought it was a
    problem with 1.3.1 on solaris, so I tried the 1.3.1 -client and while the
    performance was much better than 3 minutes, it still was slower than (which
    I expected since -client is meant for client side apps). I have no idea why
    this is happening. Below are the details of the problem.
    Oracle 8.1.7 on solaris 2.7
    Solaris 2.6
    Oracle Thin JDBC driver for 8.1.7 (classes12.zip)
    Code:
    String strQuery = "select entity_id, entity_child, period_id" +
    " FROM entity_map" +
    " WHERE entity_id >=0" +
    " AND period_id in (" + sEmptyPeriodIds + ")" +
    " ORDER BY period_id, entity_id ";
    boolean bAddedChildren = false;
    int intEntityId;
    int intChildId;
    int intPeriodId;
    //objDatabse just wraps creation and execution of resultset
    rs = objDatabase.executeSQLAndReturnResultSet( strQuery );
    //Timing start here
    while ( rs.next() )
    intEntityId = rs.getInt( 1 );
    intChildId = rs.getInt( 2 );
    intPeriodId = rs.getInt( 3 );
    // embo.addEntityMap( intPeriodId, intEntityId, intChildId );
    bAddedChildren = true;
    //Timing ends here
    If anyone has had similiar problems, I'd love to hear about it.
    Something is really really wrong with how 1.3.1 -server is optimizing the
    oracle jdbc code. Problem is that this is a black box, with no source
    available. Doesn't oracle test new versions of sun jvm's when they come
    out??
    Thanks,
    Darren
    null

    Darren,
    Good luck on trying to get any support for JDK 1.3.x with the ORACLE drivers. ORACLE doesn't support JDK 1.3.x yet. We've had other problems with the ORACLE 8.1.7 drivers. Have you tried running the same bench marks using the 8.1.6 or 8.1.6.2 drivers? I would be interested to find out if the performance problems are driver related or just JVM.
    -Peter
    See http://technet.oracle.com:89/ubb/Forum8/HTML/003853.html
    null

  • Non jdriver poor performance with oracle cluster

    Hi,
    we decided to implement batch input and went from Weblogic Jdriver to Oracle Thin 9.2.0.6.
    Our system are a Weblogic 6.1 cluster and an Oracle 8.1.7 cluster.
    Problem is .. with the new Oracle drivers our actions on the webapp takes twice as long as with Jdriver. We also tried OCI .. same problem. We switched to a single Oracle 8.1.7 database .. and it worked again with all thick or thin drivers.
    So .. new Oracle drivers with oracle cluster result in bad performance, but with Jdriver it works perfectly. Does sb. see some connection?
    I mean .. it works with Jdriver .. so it cant be the database, huh? But we really tried with every JDBC possibility! In fact .. we need batch input. Advise is very appreciated =].
    Thanx for help!!
    Message was edited by mindchild at Jan 27, 2005 10:50 AM
    Message was edited by mindchild at Jan 27, 2005 10:51 AM

    Thx for quick replys. I forget to mention .. we also tried 10g v10.1.0.3 from instantclient yesterday.
    I have to agree with Joe. It was really fast on the single machine database .. but we had same poor performance with cluster-db. It is frustrating. Specially if u consider that the Jdriver (which works perfectly in every combination) is 4 years old!
    Ok .. we got this scenario, with our appPage CustomerOverview (intensiv db-loading) (sorry.. no real profiling, time is taken with pc watch) (Oracle is 8.1.7 OPS patch level1) ...
    WL6.1_Cluster + Jdriver6.1 + DB_cluster => 4sec
    WL6.1_Cluster + Jdriver6.1 + DB_single => 4sec
    WL6.1_Cluster + Ora8.1.7 OCI + DB_single => 4sec
    WL6.1_Cluster + Ora8.1.7 OCI + DB_cluster => 8-10sec
    WL6.1_Cluster + Ora9.2.0.5/6 thin + DB_single => 4sec
    WL6.1_Cluster + Ora9.2.0.5/6 thin + DB_cluster => 8sec
    WL6.1_Cluster + Ora10.1.0.3 thin + DB_single => 2-4sec (awesome fast!!)
    WL6.1_Cluster + Ora10.1.0.3 thin + DB_cluster => 6-8sec
    Customers rough us up, because they cannot mass order via batch input. Any suggestions how to solve this issue is very appreciated.
    TIA
    >
    >
    Markus Schaeffer wrote:
    Hi,
    we decided to implement batch input and went fromWeblogic Jdriver to Oracle Thin 9.2.0.6.
    Our system are an Weblogic 6.1 cluster and a Oracle8.1.7 cluster.
    Problem is .. with the new Oracle drivers ouractions on the webapp takes twice as long
    as with Jdriver. We also tried OCI .. same problem.We switched to a single Oracle 8.1.7
    database .. and it worked again with all thick orthin drivers.
    So .. new Oracle drivers with oracle cluster
    result in bad performance, but with
    Jdriver it works perfectly. Does sb. see someconnection?Odd. The jDriver is OCI-based, so it's something
    else. I would try the latest
    10g driver if it will work with your DBMS version.
    It's much faster than any 9.X
    thin driver.
    Joe
    I mean .. it works with Jdriver .. so it cant bethe database, huh? But we really
    tried with every JDBC possibility!
    Thanx for help!!

  • Poor performance with Oracle Spatial when spatial query invoked remotely

    Is anyone aware of any problems with Oracle Spatial (10.2.0.4 with patches 6989483 and 7003151 on Red Hat Linux 4) which might explain why a spatial query (SDO_WITHIN_DISTANCE) would perform 20 times worse when it was invoked remotely from another computer (using SQLplus) vs. invoking the very same query from the database server itself (also using SQLplus)?
    Does Oracle Spatial have any known problems with servers which use SAN disk storage? That is the primary difference between a server in which I see this poor performance and another server where the performance is fine.
    Thank you in advance for any thoughts you might share.

    OK, that's clearer.
    Are you sure it is the SQL inside the procedure that is causing the problem? To check, try extracting the SQL from inside the procedure and run it in SQLPLUS with
    set autotrace on
    set timing on
    SELECT ....If the plans and performance are the same then it may be something inside the procedure itself.
    Have you profiled the procedure? Here is an example of how to do it:
    Prompt Firstly, create PL/SQL profiler table
    @$ORACLE_HOME/rdbms/admin/proftab.sql
    Prompt Secondly, use the profiler to gather stats on execution characteristics
    DECLARE
      l_run_num PLS_INTEGER := 1;
      l_max_num PLS_INTEGER := 1;
      v_geom    mdsys.sdo_geometry := mdsys.sdo_geometry(2002,null,null,sdo_elem_info_array(1,2,1),sdo_ordinate_array(0,0,45,45,90,0,135,45,180,0,180,-45,45,-45,0,0));
    BEGIN
      dbms_output.put_line('Start Profiler Result = ' || DBMS_PROFILER.START_PROFILER(run_comment => 'PARALLEL PROFILE'));  -- The comment name can be anything: here it is related to the Parallel procedure I am testing.
      v_geom := Parallel(v_geom,10,0.05,1);  -- Put your procedure call here
      dbms_output.put_line('Stop Profiler Result = ' || DBMS_PROFILER.STOP_PROFILER );
    END;
    SHOW ERRORS
    Prompt Finally, report activity
    COLUMN runid FORMAT 99999
    COLUMN run_comment FORMAT A40
    SELECT runid || ',' || run_date || ',' || run_comment || ',' || run_total_time
      FROM plsql_profiler_runs
      ORDER BY runid;
    COLUMN runid       FORMAT 99999
    COLUMN unit_number FORMAT 99999
    COLUMN unit_type   FORMAT A20
    COLUMN unit_owner  FORMAT A20
    COLUMN text        FORMAT A100
    compute sum label 'Total_Time' of total_time on runid
    break on runid skip 1
    set linesize 200
    SELECT u.runid || ',' ||
           u.unit_name,
           d.line#,
           d.total_occur,
           d.total_time,
           text
    FROM   plsql_profiler_units u
           JOIN plsql_profiler_data d ON u.runid = d.runid
                                         AND
                                         u.unit_number = d.unit_number
           JOIN all_source als ON ( als.owner = 'CODESYS'
                                   AND als.type = u.unit_type
                                   AND als.name = u.unit_name
                                AND als.line = d.line# )
    WHERE  u.runid = (SELECT max(runid) FROM plsql_profiler_runs)
    ORDER BY d.total_time desc;Run the profiler in both environments and see if you can see where the slowdown exists.
    regards
    Simon

  • Deploying .jar with Oracle JDBC thin driver

    I was just experimenting with a Java application that uses an Oracle JDBC driver. It runs fine in JDeveloper. However, when I deploy it to a .jar and run it from a Windows XP Command Prompt I get:
    Microsoft Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.
    C:\xxx\deploy>java -jar testme.jar
    Exception in thread "main" java.lang.NullPointerException
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    Is there anything special I need to do to the Deploy file? I tried including the the classes111 manifest to no avail.

    Hi,
    Ensure that the JVM being used is the same or at least same spec level that you built your project. JDeveloper 9.0.3 uses VM's compatible with 1.3.1 by default. It is possible that your OS path has another VM that the cmd line defaults to. Use a java -version to check this.
    Also ensure that you include Oracle JDBC as a project library and when you go to create a JAR file (either simple archiver or a Client Jar) that you include the Oracle JDBC libraries from the Dependency Analyzer. I assume this is probably the missing step since your are deploying to a Jar and not an app server where you would put the driver libraries in the app server classpath.

  • Hanging problem with Oracle JDBC thin driver

    Hi. We have an application running on top of WLS 6.1 accessing Oracle 8I with oracle's
    JDBC thin driver. Under stress testing, it appears to hang sometimes. Thread dump
    shows that many threads seem to be stuck at the same line of code in JDBC driver
    (at oracle.sql.NUMBER._isPositive(NUMBER.java:2882)). Has anyone run into similar
    issue? Any help is much appreciated.
    "ExecuteThread: '1' for queue: 'default'" daemon prio=5 tid=0xe18960 nid=0xf wai
    ting on monitor [0xb3680000..0xb36819d8]
    at oracle.sql.NUMBER._isPositive(NUMBER.java:2882)
    at oracle.sql.NUMBER._fromLnxFmt(NUMBER.java:2953)
    at oracle.sql.NUMBER.toBigDecimal(NUMBER.java:557)
    at oracle.sql.NUMBER.bigDecimalValue(NUMBER.java:1872)
    at oracle.jdbc.dbaccess.DBConversion.NumberBytesToBigDecimal(DBConversion.ja
    va:1771)
    at oracle.jdbc.driver.OracleStatement.getBigDecimalValue(OracleStatement.jav
    a:3357)
    at oracle.jdbc.driver.OracleStatement.getObjectValue(OracleStatement.java:41
    66)
    at oracle.jdbc.driver.OracleStatement.getObjectValue(OracleStatement.java:41
    23)
    at oracle.jdbc.driver.OracleResultSetImpl.getObject(OracleResultSetImpl.java
    :401)
    at weblogic.jdbc.jts.ResultSet.getObject(ResultSet.java:268)
    at weblogic.jdbc.rmi.internal.ResultSetImpl.getObject(ResultSetImpl.java:592
    at weblogic.jdbc.rmi.internal.ResultSetStraightReader.getObject(ResultSetStr
    aightReader.java:198)
    at weblogic.jdbc.rmi.SerialResultSet.getObject(SerialResultSet.java:682)
    "ExecuteThread: '6' for queue: 'default'" daemon prio=5 tid=0x6d93a8 nid=0x14
    wa
    iting on monitor [0xb3180000..0xb31819d8]
    at oracle.sql.NUMBER._isPositive(NUMBER.java:2882)
    at oracle.sql.NUMBER._fromLnxFmt(NUMBER.java:2953)
    at oracle.sql.NUMBER.toBigDecimal(NUMBER.java:557)
    at oracle.sql.NUMBER.bigDecimalValue(NUMBER.java:1872)
    at oracle.jdbc.dbaccess.DBConversion.NumberBytesToBigDecimal(DBConversion.ja
    va:1771)
    at oracle.jdbc.driver.OracleStatement.getBigDecimalValue(OracleStatement.jav
    a:3357)
    at oracle.jdbc.driver.OracleStatement.getObjectValue(OracleStatement.java:41
    66)
    at oracle.jdbc.driver.OracleStatement.getObjectValue(OracleStatement.java:41
    23)
    at oracle.jdbc.driver.OracleResultSetImpl.getObject(OracleResultSetImpl.java
    :401)
    at weblogic.jdbc.jts.ResultSet.getObject(ResultSet.java:268)
    at weblogic.jdbc.rmi.internal.ResultSetImpl.getObject(ResultSetImpl.java:592
    at weblogic.jdbc.rmi.internal.ResultSetStraightReader.getObject(ResultSetStr
    aightReader.java:198)
    at weblogic.jdbc.rmi.SerialResultSet.getObject(SerialResultSet.java:682)

    Try get the latest thin driver from oracle and place it in the beginning of
    the classpath in the server startup script to use it. This seems like a
    oracle thin driver bug, the newer driver might help.
    sree
    "Andrew Dong" <[email protected]> wrote in message
    news:[email protected]...
    >
    Hi. We have an application running on top of WLS 6.1 accessing Oracle 8Iwith oracle's
    JDBC thin driver. Under stress testing, it appears to hang sometimes.Thread dump
    shows that many threads seem to be stuck at the same line of code in JDBCdriver
    (at oracle.sql.NUMBER._isPositive(NUMBER.java:2882)). Has anyone run intosimilar
    issue? Any help is much appreciated.
    "ExecuteThread: '1' for queue: 'default'" daemon prio=5 tid=0xe18960nid=0xf wai
    ting on monitor [0xb3680000..0xb36819d8]
    at oracle.sql.NUMBER._isPositive(NUMBER.java:2882)
    at oracle.sql.NUMBER._fromLnxFmt(NUMBER.java:2953)
    at oracle.sql.NUMBER.toBigDecimal(NUMBER.java:557)
    at oracle.sql.NUMBER.bigDecimalValue(NUMBER.java:1872)
    atoracle.jdbc.dbaccess.DBConversion.NumberBytesToBigDecimal(DBConversion.ja
    va:1771)
    atoracle.jdbc.driver.OracleStatement.getBigDecimalValue(OracleStatement.jav
    a:3357)
    atoracle.jdbc.driver.OracleStatement.getObjectValue(OracleStatement.java:41
    66)
    atoracle.jdbc.driver.OracleStatement.getObjectValue(OracleStatement.java:41
    23)
    atoracle.jdbc.driver.OracleResultSetImpl.getObject(OracleResultSetImpl.java
    :401)
    at weblogic.jdbc.jts.ResultSet.getObject(ResultSet.java:268)
    atweblogic.jdbc.rmi.internal.ResultSetImpl.getObject(ResultSetImpl.java:592
    atweblogic.jdbc.rmi.internal.ResultSetStraightReader.getObject(ResultSetStr
    aightReader.java:198)
    atweblogic.jdbc.rmi.SerialResultSet.getObject(SerialResultSet.java:682)
    >
    "ExecuteThread: '6' for queue: 'default'" daemon prio=5 tid=0x6d93a8nid=0x14
    wa
    iting on monitor [0xb3180000..0xb31819d8]
    at oracle.sql.NUMBER._isPositive(NUMBER.java:2882)
    at oracle.sql.NUMBER._fromLnxFmt(NUMBER.java:2953)
    at oracle.sql.NUMBER.toBigDecimal(NUMBER.java:557)
    at oracle.sql.NUMBER.bigDecimalValue(NUMBER.java:1872)
    atoracle.jdbc.dbaccess.DBConversion.NumberBytesToBigDecimal(DBConversion.ja
    va:1771)
    atoracle.jdbc.driver.OracleStatement.getBigDecimalValue(OracleStatement.jav
    a:3357)
    atoracle.jdbc.driver.OracleStatement.getObjectValue(OracleStatement.java:41
    66)
    atoracle.jdbc.driver.OracleStatement.getObjectValue(OracleStatement.java:41
    23)
    atoracle.jdbc.driver.OracleResultSetImpl.getObject(OracleResultSetImpl.java
    :401)
    at weblogic.jdbc.jts.ResultSet.getObject(ResultSet.java:268)
    atweblogic.jdbc.rmi.internal.ResultSetImpl.getObject(ResultSetImpl.java:592
    atweblogic.jdbc.rmi.internal.ResultSetStraightReader.getObject(ResultSetStr
    aightReader.java:198)
    atweblogic.jdbc.rmi.SerialResultSet.getObject(SerialResultSet.java:682)
    >
    >

  • Ssl with Oracle jdbc thin driver on weblogic 9.2

    http://www.oracle.com/technology/products/weblogic/howto/jdbcssl/index.html
    http://www.oracle.com/technology/tech/java/sqlj_jdbc/pdf/wp-oracle-jdbc_thin_ssl_2007.pdf
    I had already created the ssl-jdbc connections for Weblogic 9.2 with Oracle 10.2.0.3.0 based on the documents above.
    My questions
    1. the connections are not using the desired ports. The TCP listener is using 1521, and TCPS listener is using 1522, and 2484. However the connections do not use the configured ports. Is it normal?
    2. If using the unassigned port is the normal case, where can I limit the port range?
    3. How to prove the connections are in SSL?

    1. the connections are not using the desired ports. The TCP listener is using 1521, and TCPS listener is using 1522, and 2484. However the connections do not use the configured ports. Is it normal? It is normal.
    2. If using the unassigned port is the normal case, where can I limit the port range? I still have no idea.
    3. How to prove the connections are in SSL? No idea, too.

  • Modifiy and maximize performance of Oracle JDBC driver

    Hello all,
    due to some boring errors I'm trying to modify and maximize my JDBC driver for oracle connection... in particular I've two questions:
    1. to substitute oracle driver with a newer version you have simply to upgrade the JDBC driver in $ODI_HOME/drivers/ORACLE or you have to add/modify the file named DriverRefV3.xml in sunopsis.zip. In particular I've checked DriverRefV3.xml but there's not reference to the file used for oracle connection so I do not know if ODI is using the ojdbc5.jar updated present in ODI_HOME/drivers/ORACLE
    2. Oracle JDBC driver supports some properties as inactivity-timeout. Usually these are related to connection pool opened to the database. I want to change these properties...it's possible?
    Thanks
    Stefano

    Hi Stefano ,
    If you have only 1 Oracle JDBC driver ie. ojdbc5.jar in $ODI_HOME/drivers the ODI have to use that driver only (provided you are using correct JDK for that driver )
    DriverRefV3.xml is for listing down the driver in the JDBC connection URL
    Unless and until you have the driver in $ODI_HOME/drivers , DriverRefV3.xml will not help you.
    Have no idea about timeout setting in JDBC .
    If you find answer then it will be very helpful if you can share the same in this forum .
    Thanks,
    Sutirtha

  • GetObject(int, Map) not working with oracle JDBC

    I'm using Oracle and I'd like to get Date fields as Timestamps since an Oracle date column includes time. I'm trying to use getObject(int, Map) to map the types to Java objects, but it's not working. This is my code:
         public static final HashMap oracleMap = new HashMap();
         static{
              try{
                   oracleMap.put( "DATE", Class.forName("java.sql.Timestamp") );
                   oracleMap.put( "NUMBER", Class.forName("java.math.BigDecimal") );
                   oracleMap.put( "VARCHAR2", Class.forName("java.lang.String") );
                   oracleMap.put( "CLOB", Class.forName("java.sql.Clob") );
                   oracleMap.put( "LONG", Class.forName("java.lang.String") );
              }catch(Exception e){
                   IllegalStateException ise = new IllegalStateException("Oracle type mapping failed.");
                   ise.initCause(e);
                   throw ise;
         }And
                        BASE.println("rs.getClass().getName(): "+rs.getClass().getName());                                        
                        BASE.println("rs.getMetaData().getColumnTypeName(i): "+rs.getMetaData().getColumnTypeName(i));
                        if(rs.getClass().getName().startsWith("oracle")) valObj = rs.getObject(i, DOMTools.oracleMap);                    
                        else valObj = rs.getObject(i);                    
                        BASE.println("valObj.getClass().getName(): "+valObj.getClass().getName());Here's a snippet of my output that illustrates the code not working:
    rs.getClass().getName(): oracle.jdbc.driver.OracleResultSetImpl
    rs.getMetaData().getColumnTypeName(i): DATE
    valObj.getClass().getName(): java.sql.Date
    Anyone know if this is a driver issue? Anyone had luck doing this with Oracle?
    Thanks.

    Well, I'd like it to be java.sql.Timestamp instead of
    java.sql.Date. My actual type is an oracle "DATE".
    Are you saying the Map key for this would be
    "TIMESTAMP" and that by default it maps to
    java.sql.Date? Doesn't seem like that makes sense.I am saying that "TIMESTAMP" is not an oracle value but is instead a JDBC value. Thus it is up to to the driver, not you, to determine what oracle types map to the JDBC type.

  • CLassCastException with oracle.jdbc.driver.OracleCallableStatement

    Hello,
    I get a ClassCastException when I try to execute a Stored Procedure with WL6.1
    and the JDriver.
    I have a servlet who intanciate a Bean and call to his execute() method in this
    way:
    Context ctx = null;
    Hashtable ht = new Hashtable();
    Connection conn = null;
    ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
    try {
    ctx = new InitialContext(ht);
    javax.sql.DataSource ds = (javax.sql.DataSource)ctx.lookup(connPool);
    conn = ds.getConnection();
    conn.setAutoCommit(true);
    SvcEmpEstObt empEstObt = new SvcEmpEstObt();
    empEstObt.setMaxRows(100);
    empEstObt.setConnection(conn);
    //Get parameters from Http Get and set the JB
    empEstObt.setEmpRut(request.getParameter("rut"));
    empEstObt.setEmpTimeStamp(request.getParameter("timestamp"));
    //Execute Service
    empEstObt.execute();
    /* ********* the execute() method of the jb is listed here */
    public int execute() throws ClassNotFoundException, SQLException{
    intreturnedRows = 0;
    try {if (connection == null){
    try {Class.forName(driver);
    } catch (ClassNotFoundException e) {
    System.err.println("ClassNotFoundException: " + e);
    throw e;
    connection = DriverManager.getConnection(url, user, password);
    row = -1;
    srv_message = String.valueOf(maxRows);
    String sp = "{call SvcEmpEstObt_Pkg.SvcEmpEstObt(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}";
    oracle.jdbc.driver.OracleCallableStatement procout = (oracle.jdbc.driver.OracleCallableStatement)
    connection.prepareCall(sp); // The exception is here
    procout.registerOutParameter(1, Types.VARCHAR);
    procout.setString(1, srv_message);
    procout.setString(2, empRut);
    procout.setString(3, empTimeStamp);
    procout.registerOutParameter(4, Types.VARCHAR);
    procout.registerOutParameter(5, Types.VARCHAR);
    procout.registerOutParameter(6, Types.INTEGER);
    int elemSqlType = OracleTypes.INTEGER;
    int elemMaxLen = 0;
    procout.registerIndexTableOutParameter(7, maxRows, elemSqlType, elemMaxLen);
    elemSqlType = OracleTypes.VARCHAR;
    elemMaxLen = 30;
    // register the OUT parameter
    procout.registerIndexTableOutParameter(8, maxRows, elemSqlType, elemMaxLen);
    elemSqlType = OracleTypes.VARCHAR;
    elemMaxLen = 21;
    // register the OUT parameter
    procout.registerIndexTableOutParameter(9, maxRows, elemSqlType, elemMaxLen);
    elemSqlType = OracleTypes.INTEGER;
    elemMaxLen = 0;
    // register the OUT parameter
    procout.registerIndexTableOutParameter(10, maxRows, elemSqlType, elemMaxLen);
    // execute the call
    procout.execute();
    sqlWarning = procout.getWarnings();
    srv_message = procout.getString(1);
    returnStatus = new Integer(srv_message.substring(0,1)).intValue();
    dagMessage = new DagMessage();
    dagMessage.oracleMessage(srv_message);
    // access the value using JDBC default mapping
    empEstTitulo = procout.getString(4);
    empEstUniv = procout.getString(5);
    empEstNivel = procout.getInt(6);
    curCodigo = (BigDecimal[]) procout.getPlsqlIndexTable(7);
    curNombre = (String[]) procout.getPlsqlIndexTable(8);
    curFecha = (String[]) procout.getPlsqlIndexTable(9);
    curDuracion = (BigDecimal[]) procout.getPlsqlIndexTable(10);
    // close the statement
    procout.close();
    if (curCodigo == null) {
    return 0;
    } else {
    return curCodigo.length;
    } catch (SQLException e) {
    SQLException ex = e;
    System.err.println("\n--- SQLException caught ---\n");
    while (ex != null) {
    System.err.println("Message: " + ex.getMessage ());
    System.err.println("SQLState: " + ex.getSQLState ());
    System.err.println("ErrorCode: " + ex.getErrorCode ());
    ex = ex.getNextException();
    System.out.println("");
    throw e;
    Does Someone has an idea why it happens ?

    Hans,
    Could you give us the whole text of exception?
    Regards,
    Slava Imeshev
    "Hans" <[email protected]> wrote in message
    news:[email protected]...
    >
    It Works! Thanx a lot ....
    I was working with a previous version of my App ... I fixed the problemand now
    i can Cast to weblogic.jdbc.vendor.oracle.OracleCallableStatement,
    But ...
    I get the following Exception:
    SQL Exception:
    registerIndexTableOutParameter is not supported by the
    underlying JDBC driver weblogic.jdbc.pool.Connection
    What I need to do ?
    /* this is what i`m trying to make */
    weblogic.jdbc.vendor.oracle.OracleCallableStatement procout =(weblogic.jdbc.vendor.oracle.OracleCallableStatement)
    connection.prepareCall(sp);
    procout.registerOutParameter(1, Types.VARCHAR);
    procout.setString(1, srv_message);
    procout.setString(2, empRut);
    procout.setString(3, empTimeStamp);
    procout.registerOutParameter(4, Types.VARCHAR);
    procout.registerOutParameter(5, Types.VARCHAR);
    procout.registerOutParameter(6, Types.INTEGER);
    int elemSqlType = OracleTypes.INTEGER;
    int elemMaxLen = 0;
    procout.registerIndexTableOutParameter(7, maxRows, elemSqlType,elemMaxLen);
    >
    elemSqlType = OracleTypes.VARCHAR;
    elemMaxLen = 30;
    // register the OUT parameter
    procout.registerIndexTableOutParameter(8, maxRows, elemSqlType,elemMaxLen);
    >
    elemSqlType = OracleTypes.VARCHAR;
    elemMaxLen = 21;
    // register the OUT parameter
    procout.registerIndexTableOutParameter(9, maxRows, elemSqlType,elemMaxLen);
    >
    elemSqlType = OracleTypes.INTEGER;
    elemMaxLen = 0;
    // register the OUT parameter
    procout.registerIndexTableOutParameter(10, maxRows, elemSqlType,elemMaxLen);
    >
    >
    "Hans" <[email protected]> wrote:
    Thanx Slava,
    But I have the same problem again...
    I replace oracle.jdbc.driver.OracleCallableStatement with
    weblogic.jdbc.vendor.oracle.OracleCallableStatement
    and I get the same ClassClastException in
    weblogic.jdbc.vendor.oracle.OracleCallableStatement procout =
    (weblogic.jdbc.vendor.oracle.OracleCallableStatement)
    connection.prepareCall(sp);
    Any ideas ??
    "Slava Imeshev" <[email protected]> wrote:
    Hi Hans,
    You can not cast returned object to
    oracle.jdbc.driver.OracleCallableStatement
    when accessing oracle db via connection pool.
    It can be casted to weblogic.jdbc.vendor.oracle.OracleCallableStatement.
    Here is a list of methods supported by this interface:
    void clearParameters() throws java.sql.SQLException;
    void registerIndexTableOutParameter(int i, int j, int k, int l) throws
    java.sql.SQLException;
    void registerOutParameter(int i, int j, int k, int l) throws
    java.sql.SQLException;
    java.sql.ResultSet getCursor(int i) throws java.sql.SQLException;
    java.io.InputStream getAsciiStream(int i) throws
    java.sql.SQLException;
    java.io.InputStream getBinaryStream(int i) throwsjava.sql.SQLException;
    java.io.InputStream getUnicodeStream(int i) throwsjava.sql.SQLException;
    >>>
    Regards,
    Slava Imeshev
    "Hans" <[email protected]> wrote in message
    news:[email protected]...
    Hello,
    I get a ClassCastException when I try to execute a Stored Procedurewith
    WL6.1
    and the JDriver.
    I have a servlet who intanciate a Bean and call to his execute()
    method
    in
    this
    way:
    Context ctx = null;
    Hashtable ht = new Hashtable();
    Connection conn = null;
    ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFact
    or
    y");
    try {
    ctx = new InitialContext(ht);
    javax.sql.DataSource ds = (javax.sql.DataSource)ctx.lookup(connPool);
    conn = ds.getConnection();
    conn.setAutoCommit(true);
    SvcEmpEstObt empEstObt = new SvcEmpEstObt();
    empEstObt.setMaxRows(100);
    empEstObt.setConnection(conn);
    file://Get parameters from Http Get and set the JB
    empEstObt.setEmpRut(request.getParameter("rut"));
    empEstObt.setEmpTimeStamp(request.getParameter("timestamp"));
    file://Execute Service
    empEstObt.execute();
    /* ********* the execute() method of the jb is listed here */
    public int execute() throws ClassNotFoundException, SQLException{
    intreturnedRows = 0;
    try {if (connection == null){
    try {Class.forName(driver);
    } catch (ClassNotFoundException e) {
    System.err.println("ClassNotFoundException: " + e);
    throw e;
    connection = DriverManager.getConnection(url, user, password);
    row = -1;
    srv_message = String.valueOf(maxRows);
    String sp = "{call SvcEmpEstObt_Pkg.SvcEmpEstObt(?, ?, ?, ?, ?, ?,?, ?,
    oracle.jdbc.driver.OracleCallableStatement procout =(oracle.jdbc.driver.OracleCallableStatement)
    connection.prepareCall(sp); // The exception is here
    procout.registerOutParameter(1, Types.VARCHAR);
    procout.setString(1, srv_message);
    procout.setString(2, empRut);
    procout.setString(3, empTimeStamp);
    procout.registerOutParameter(4, Types.VARCHAR);
    procout.registerOutParameter(5, Types.VARCHAR);
    procout.registerOutParameter(6, Types.INTEGER);
    int elemSqlType = OracleTypes.INTEGER;
    int elemMaxLen = 0;
    procout.registerIndexTableOutParameter(7, maxRows, elemSqlType,elemMaxLen);
    elemSqlType = OracleTypes.VARCHAR;
    elemMaxLen = 30;
    // register the OUT parameter
    procout.registerIndexTableOutParameter(8, maxRows, elemSqlType,elemMaxLen);
    elemSqlType = OracleTypes.VARCHAR;
    elemMaxLen = 21;
    // register the OUT parameter
    procout.registerIndexTableOutParameter(9, maxRows, elemSqlType,elemMaxLen);
    elemSqlType = OracleTypes.INTEGER;
    elemMaxLen = 0;
    // register the OUT parameter
    procout.registerIndexTableOutParameter(10, maxRows, elemSqlType,elemMaxLen);
    // execute the call
    procout.execute();
    sqlWarning = procout.getWarnings();
    srv_message = procout.getString(1);
    returnStatus = new Integer(srv_message.substring(0,1)).intValue();
    dagMessage = new DagMessage();
    dagMessage.oracleMessage(srv_message);
    // access the value using JDBC default mapping
    empEstTitulo = procout.getString(4);
    empEstUniv = procout.getString(5);
    empEstNivel = procout.getInt(6);
    curCodigo = (BigDecimal[]) procout.getPlsqlIndexTable(7);
    curNombre = (String[]) procout.getPlsqlIndexTable(8);
    curFecha = (String[]) procout.getPlsqlIndexTable(9);
    curDuracion = (BigDecimal[]) procout.getPlsqlIndexTable(10);
    // close the statement
    procout.close();
    if (curCodigo == null) {
    return 0;
    } else {
    return curCodigo.length;
    } catch (SQLException e) {
    SQLException ex = e;
    System.err.println("\n--- SQLException caught ---\n");
    while (ex != null) {
    System.err.println("Message: " + ex.getMessage ());
    System.err.println("SQLState: " + ex.getSQLState ());
    System.err.println("ErrorCode: " + ex.getErrorCode ());
    ex = ex.getNextException();
    System.out.println("");
    throw e;
    Does Someone has an idea why it happens ?

  • Problem with Oracle jdbc driver and jdk1.4

    Hi
    I have some java code which uses Oracle jdbc driver.
    This code works with java 1.1.8, 1.2 & 1.3 but not with java 1.4 !
    I have that exception :
    java.sql.SQLException: The Network Adapter could not establish the connection
    at oracle/jdbc/dbaccess/DBError.check_error(DBError.java)
    at oracle/jdbc/driver/OracleConnection.<init>(OracleConnection.java)
    at oracle/jdbc/driver/OracleDriver.getConnectionInstance(OracleDriver.java)
    at oracle/jdbc/driver/OracleDriver.connect(OracleDriver.java)
    at java/sql/DriverManager.getConnection(DriverManager.java:529)
    at java/sql/DriverManager.getConnection(DriverManager.java:179)
    at SimpleQuery.<init>(SimpleQuery.java:21)
    at SimpleQuery.main(SimpleQuery.java:56)
    when I try a getConnection...
    I've tried all the jdbc drivers provided by Oracle, but it's still the same problem !
    Any Idea ?
    Thanks

    Have you tried the drivers shipped with Oracle9i Db R2? they should work against JDK 1.4
    Kuassi
    Hi
    I have some java code which uses Oracle jdbc driver.
    This code works with java 1.1.8, 1.2 & 1.3 but not with java 1.4 !
    I have that exception :
    java.sql.SQLException: The Network Adapter could not establish the connection
    at oracle/jdbc/dbaccess/DBError.check_error(DBError.java)
    at oracle/jdbc/driver/OracleConnection.<init>(OracleConnection.java)
    at oracle/jdbc/driver/OracleDriver.getConnectionInstance(OracleDriver.java)
    at oracle/jdbc/driver/OracleDriver.connect(OracleDriver.java)
    at java/sql/DriverManager.getConnection(DriverManager.java:529)
    at java/sql/DriverManager.getConnection(DriverManager.java:179)
    at SimpleQuery.<init>(SimpleQuery.java:21)
    at SimpleQuery.main(SimpleQuery.java:56)
    when I try a getConnection...
    I've tried all the jdbc drivers provided by Oracle, but it's still the same problem !
    Any Idea ?
    Thanks

  • Connection issues with Oracle-JDBC

    Using the Universe Design Tool in BOE 4.4 to create an Oracle-JDBC connection.
    Issue:  Test Connection fails for JDBC connection to production Oracle database.
    Getting error:
    “DBD: ORA-01034: ORACLE not available
    ORA-27101: shared memory realm does not exist
    IBM AIX RISC System/6000 Error: 2: No such file or directory”
    Things to note:
    There are three entries in the tnsnames.ora file (a prod entry, a dev entry and a test entry).  I can successfully create the JDBC connections for the test and dev entries, but not prod.
    I can go to Designer in another server (our BOE 3.5 server in a different environment) and create all three Oracle-JDBC connections.
    The Oracle middleware is the same between the two servers (11g) and the tnsnames.ora files are identical.
    The prod database is up (it would definitely be known if it were down).
    Very confused on this one.  Any help would be appreciated.

    It appears that the SAP tool “Universe Design Tool” wants to have a fully qualified (host.parent domain.org) Net Service name for this particular connection as I was able to successfully JDBC connect to our production Oracle database.  The other two databases didn't need it and the Oracle SQL Developer (which uses JDBC for connections) didn’t need a fully qualified name for our production server either.  In any case, it appears to be working now.

  • HELP!!! Cannot deploy J2EE application with Oracle JDBC driver...

    Hi,
    I am writing a J2EE application which (in theory, at least)
    connects to an Oracle 9i database.
    I have written a simple Java test app utilising only the
    java.sql package classes (e.g. Connection, ResultSet) to directly
    connect to the database. As long as the classes12.zip is in the
    CLASSPATH it works fine.
    Now I have written an Enterprise application (SessionBean,
    Remote and Home interface and Client) which I am attempting to
    deploy via deploytool.
    If I include just the client jar and EJB jar in the application
    it deploys okay but when I run the application (using runclient)
    it produces the following error:
    java.lang.NoClassDefFoundError: oracle/jdbc/OracleDriver
    (It is nested within other error output but that is the core
    issue).
    However if I try to include the JAR libraries into the app
    (classes12.jar and nls_charset.jar from $ORACLE_HOME/jdbc/lib),
    then I get the following output from deploytool when I hit the
    "deploy" (or "redeploy") button:
    Deployment error: invalid entry compressed size
    (expected 14411 but got 14580 bytes)
    Can someone please tell me what is going on???
    How can I deploy the J2EE application including the Oracle
    JDBC Driver???
    My only other option at the moment is to place all the function-
    -ality in the client and not use the J2EE framework.
    Any help is greatly appreciated.
    Regards,
    Ben New
    Leftclick Software Development
    [email protected]

    OK Ben,
    I admit I'm a bit confused. Let me see if I understand where you're
    coming from.
    You have written a J2EE application that includes a session bean,
    correct? If so, your session bean needs to be deployed to an EJB
    container. What container are you using? The Oracle 9i database
    has an embedded EJB container which (theoretically) you can use.
    However, as far as I know, Oracle recommends you use OC4J as the
    EJB container. So again I ask, what EJB container are you using?
    If, as you say, you are new to EJB, then I think you should
    immediately start working wiht OC4J as your EJB container.
    Did you look at the tutorial link I gave in my previous post? It
    explains -- step by step -- how to create, deploy and run a J2EE
    application using OC4J as the EJB container. It also has links to
    introductory material for people without little knowledge of J2EE
    and EJB.
    I have 9iAS Enterprise Edition and 8.1.7.1.0 database server (and
    OC4J) installed on my SUN machine. I cannot find any of the
    utilities you mention -- "j2eeadmin","runclient" or "deploytool".
    What Oracle software have you installed? What are the versions?
    What platform are you using?
    A J2EE application (according to the specification from SUN)
    consists of modules. A module can either be a client module or an
    EJB module. A client module can either be a java application client
    or a web-based client (servlet or JSP). A J2EE application usually
    contains one client module and one EJB module. A J2EE application
    needs to be deployed to a J2EE container.
    Hopefully the J2EE picture is becoming clearer. I think you need
    to read some introductory material regarding J2EE if you intend
    to become proficient at it.
    I feel that you are under the impression that a J2EE application
    is a glorified JDBC application. It isn't (as far as I'm aware).
    Good Luck,
    Avi.

  • Problems with Oracle jdbc Driver

    Hi... I'm trying to connect to my Oracle Database and I get the folowing error:
    "package oracle.jdbc.driver does not exist"
    I have installed Oracle 9.1.0.2 Database...
    The value of the Classpath variable is:
    ".;c:\oracle\ora92\jdbc\lib"
    What could be the problem???...
    Thanks in advance.-
    Alberto.-

    Are you building your application from the command line? Or using a GUI? GUI's will frequently overwrite your CLASSPATH environment variable...
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Slow performance with oracle http server connecting weblogic

    I have a performance issue while using Oracle HTTP server as a proxy with weblogic server. It takes 10-15 seconds to pass the requests.
    I also received the error related to SSL in my error logs even though i havent configured the SSL.
    please find the error received in the OHS error logs
    nzos handshake error, nzos_Handshake returned 28862
    NZ Library Error: SSL IO error [Hint: the client stop the connection unexpectedly]
    And please find a request information from the access log files.
    Fri May 28 09:24:48 2010 <5944127503148828> getPooledConn: No more connections in the pool for Host[114.57.162.39] Port[6499] SecurePort[6499]
    Fri May 28 09:24:48 2010 <5944127503148828> general list: trying connect to '114.57.162.39'/6499/6499 at line 3082 for '/fed/user/authnoam?refid=id-ixGFItkxw4Nt4l3wlz4W9sWR-ao-'
    Fri May 28 09:25:00 2010 <5944127503148828> SSL is not configured for this connection
    Fri May 28 09:25:00 2010 <5944127503148828> Local Port of the socket is 4472
    it is visible that the while it is doing "general list trying to connect to" it takes a long time
    Any pointers are highly appreciated.

    Shannon,
    The OHS + Weblogic installation, just means you will have an admin server, with Enterprise Manager that can manage your OHS instances. That being said:
    1 - You don't have to extend any domain, since the only thing OHS will need is an Admin Server with Enterprise Manager.
    2 - I (myself, I don't speak for Oracle here) have a personal preference of having stand alone OHS. If you don't know how to work with httpd.conf and mod_wl.conf, I would suggest installing a separate domain only for it, that way you can keep the weblogic turned off, and turn it on only when you need to edit any configuration.
    Thanks

Maybe you are looking for