-
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
-
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:weblogic racle,\
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
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks