JDBC, weblogic and Oracle


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: JDBC, weblogic and Oracle

Hybrid View

  1. #1
    Shailesh Guest

    JDBC, weblogic and Oracle


    I have two questions:
    1. Has any body used connection pool from weblogic to access cursor variable
    from Oracle.
    Scenerio: I have a stored procedure which returns resultset ( more than one
    row). I am trying to use package and stored procedure to return cursor. It
    works fine if I create connection directly, but does not work with weblogic's
    connection pool mechanism. I am using weblogic 5.1.

    2. Does JDBC support creating SQL with null values in where clause? i.e if
    I pass null value for a varibale in where clause, is there any way that it
    will translate it to be 'is null' rather than '= null'.

    Thanks.
    Shailesh

  2. #2
    ANIL DATT Guest

    Re: JDBC, weblogic and Oracle


    Hi shailesh,

    What driver are u using for the connection pool?
    You can use either weblogic oci driver or Oracle thin driver(WL5.1). Hope
    your cursor on Oracle is a reference cursor!!


    Following is the code to execute sp...

    MyStatement =(weblogic.jdbc.common.OracleCallableStatement)MyConnection.prepareCall("BEGIN
    userlogin.getuserlogin(?,?,?); END;");
    MyStatement.setString(1,UserName);
    MyStatement.setString(2,PassWord);
    MyStatement.registerOutParameter(3, java.sql.Types.OTHER);
    MyStatement.execute();

    In the above code replace the OracleCallableStatement with CallableStatement
    if you are using Oracle Thin driver. Also OracleTypes in place of java.sql.Types.



    Folloing is the code for Connection Pool


    weblogic.jdbc.connectionPool.yourpoolname=\
    url=jdbc:weblogicracle,\
    driver=weblogic.jdbc.oci.Driver,\
    loginDelaySecs=1,\
    initialCapacity=4,\
    maxCapacity=10,\
    capacityIncrement=2,\
    allowShrinking=true,\
    shrinkPeriodMins=15,\
    refreshMinutes=10,\
    testTable=dual,\
    props=user=username;password=password;server=servername





    "Shailesh" <sdesai@medassets.com> wrote:
    >
    >I have two questions:
    >1. Has any body used connection pool from weblogic to access cursor variable
    >from Oracle.
    >Scenerio: I have a stored procedure which returns resultset ( more than

    one
    >row). I am trying to use package and stored procedure to return cursor.

    It
    >works fine if I create connection directly, but does not work with weblogic's
    >connection pool mechanism. I am using weblogic 5.1.
    >
    >2. Does JDBC support creating SQL with null values in where clause? i.e

    if
    >I pass null value for a varibale in where clause, is there any way that

    it
    >will translate it to be 'is null' rather than '= null'.
    >
    >Thanks.
    >Shailesh



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center