RE: Casting DBCP Connection to OracleConnection - Solved IT!

2003-04-01 Thread Marco Rossi
Now it's working!!
Thanks guys!

I'm sorry, but i think to have an old release of commons-dbcp.jar, and i don't' find 
the getDelegate() method. It's in org.apache.commons.dbcp.PoolableConnection class??

In my tomcat common/lib; apparently it is the debug version of Oracle's
jdbc implentation. Download classes12.zip ( and rename to classes12.jar
) from Oracle site.

Sundar

-Original Message-
From: Marco Rossi [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 31, 2003 11:25 AM
To: Tomcat Users List
Subject: RE: Casting DBCP Connection to OracleConnection - Solved IT!

Where do you find ojdbc_g.jar?

I was using ojdbc_g.jar instead of classes12.zip ( i.e classes12.jar )

Sundar

-Original Message-
From: Chakravarthy, Sundar 
Sent: Monday, March 31, 2003 11:11 AM
To: Tomcat Users List
Subject: RE: Casting DBCP Connection to OracleConnection

Strange .. the getDelegate().getClass().getName() returns
oracle.jdbc.driver.OracleConnection . But the cast fails at runtime.

Sundar

-Original Message-
From: Filip Hanik [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 31, 2003 11:05 AM
To: Tomcat Users List
Subject: RE: Casting DBCP Connection to OracleConnection

hi Sundar,
as an alternative, why don't you print the class names to know what you
are
doing

for example

System.out.println(delegate=+conn.getDelegate().getClass().getName())
;

and do that for all of the things you try to cast, that way you can see
what
you are accessing before you try to cast it

Filip

 -Original Message-
 From: Chakravarthy, Sundar [mailto:[EMAIL PROTECTED]
 Sent: Monday, March 31, 2003 7:57 AM
 To: Tomcat Users List
 Subject: RE: Casting DBCP Connection to OracleConnection



 Run-time failure using both getInnermostDelegate() and getDelegate().
 Any other alternatives ?

 -Sundar

 -Original Message-
 From: Tim Funk [mailto:[EMAIL PROTECTED]
 Sent: Monday, March 31, 2003 10:49 AM
 To: Tomcat Users List
 Subject: Re: Casting DBCP Connection to OracleConnection

 Compile fail or run-time fail?

 If compile fail - you need a nightly of dbcp.
 If run-time fail, you may need to use getInnermostDelegate() instead

 -Tim

 Chakravarthy, Sundar wrote:
  I tried the following with no success,
 
  1. PoolableConnection pc = (PoolableConnection)conn;
  2. OracleConnection oc = (OracleConnection)pc.getDelegate();
 
  Fails in line 2
 
  -Sundar
 
 
  -Original Message-
  From: Tim Funk [mailto:[EMAIL PROTECTED]
  Sent: Monday, March 31, 2003 10:34 AM
  To: Tomcat Users List
  Subject: Re: Casting DBCP Connection to OracleConnection
 
  All dbcp objects have a getDelegate() method (I think). But you'll
 need
  to do 2 casts.
  - dbcpConn = (DBCPClassCast)conn-- The dbcp connection
  - myOraConn = (OraClassCast)dbcpConn.getDelegate() -- Get the
  underlying implementation
 
  Look at the DBCP javadocs for the correct class names.
 
  BUT you'll need to use a nightly build of dbcp to do this since the
  version shipped with tomcat doesn't have the getDeletgate()
methods.
 
  -Tim
 
  Marco Rossi wrote:
 
 I have the same problem. If you find a solution, please reply
 
 
 
 HI,
 
 I am using Tomcat 4.1.18 with Oracle 9i. When I try to cast the
 Connection returned from DBCP to OracleConnection I get a
 ClassCastException .
 
 Anyone here know how to cast correctly ?
 
 Thanks
 
 
 
 
 
-
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail:
[EMAIL PROTECTED]
 
 
 
-
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail:
[EMAIL PROTECTED]
 
 
 


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e

Re: Casting DBCP Connection to OracleConnection

2003-03-31 Thread Marco Rossi
I have the same problem. If you find a solution, please reply


HI,

I am using Tomcat 4.1.18 with Oracle 9i. When I try to cast the
Connection returned from DBCP to OracleConnection I get a
ClassCastException .

Anyone here know how to cast correctly ?

Thanks

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Casting DBCP Connection to OracleConnection

2003-03-31 Thread Tim Funk
All dbcp objects have a getDelegate() method (I think). But you'll need 
to do 2 casts.
- dbcpConn = (DBCPClassCast)conn-- The dbcp connection
- myOraConn = (OraClassCast)dbcpConn.getDelegate() -- Get the 
underlying implementation

Look at the DBCP javadocs for the correct class names.

BUT you'll need to use a nightly build of dbcp to do this since the 
version shipped with tomcat doesn't have the getDeletgate() methods.

-Tim

Marco Rossi wrote:
I have the same problem. If you find a solution, please reply


HI,

I am using Tomcat 4.1.18 with Oracle 9i. When I try to cast the
Connection returned from DBCP to OracleConnection I get a
ClassCastException .
Anyone here know how to cast correctly ?

Thanks



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Casting DBCP Connection to OracleConnection

2003-03-31 Thread Chakravarthy, Sundar
I tried the following with no success,

1. PoolableConnection pc = (PoolableConnection)conn;
2. OracleConnection oc = (OracleConnection)pc.getDelegate();

Fails in line 2

-Sundar


-Original Message-
From: Tim Funk [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 31, 2003 10:34 AM
To: Tomcat Users List
Subject: Re: Casting DBCP Connection to OracleConnection

All dbcp objects have a getDelegate() method (I think). But you'll need 
to do 2 casts.
- dbcpConn = (DBCPClassCast)conn-- The dbcp connection
- myOraConn = (OraClassCast)dbcpConn.getDelegate() -- Get the 
underlying implementation

Look at the DBCP javadocs for the correct class names.

BUT you'll need to use a nightly build of dbcp to do this since the 
version shipped with tomcat doesn't have the getDeletgate() methods.

-Tim

Marco Rossi wrote:
 I have the same problem. If you find a solution, please reply
 
 
HI,

I am using Tomcat 4.1.18 with Oracle 9i. When I try to cast the
Connection returned from DBCP to OracleConnection I get a
ClassCastException .

Anyone here know how to cast correctly ?

Thanks
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Casting DBCP Connection to OracleConnection

2003-03-31 Thread Tim Funk
Compile fail or run-time fail?

If compile fail - you need a nightly of dbcp.
If run-time fail, you may need to use getInnermostDelegate() instead
-Tim

Chakravarthy, Sundar wrote:
I tried the following with no success,

1. PoolableConnection pc = (PoolableConnection)conn;
2. OracleConnection oc = (OracleConnection)pc.getDelegate();
Fails in line 2

-Sundar

-Original Message-
From: Tim Funk [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 31, 2003 10:34 AM
To: Tomcat Users List
Subject: Re: Casting DBCP Connection to OracleConnection

All dbcp objects have a getDelegate() method (I think). But you'll need 
to do 2 casts.
- dbcpConn = (DBCPClassCast)conn-- The dbcp connection
- myOraConn = (OraClassCast)dbcpConn.getDelegate() -- Get the 
underlying implementation

Look at the DBCP javadocs for the correct class names.

BUT you'll need to use a nightly build of dbcp to do this since the 
version shipped with tomcat doesn't have the getDeletgate() methods.

-Tim

Marco Rossi wrote:

I have the same problem. If you find a solution, please reply



HI,

I am using Tomcat 4.1.18 with Oracle 9i. When I try to cast the
Connection returned from DBCP to OracleConnection I get a
ClassCastException .
Anyone here know how to cast correctly ?

Thanks



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Casting DBCP Connection to OracleConnection

2003-03-31 Thread Chakravarthy, Sundar

Run-time failure using both getInnermostDelegate() and getDelegate().
Any other alternatives ? 

-Sundar

-Original Message-
From: Tim Funk [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 31, 2003 10:49 AM
To: Tomcat Users List
Subject: Re: Casting DBCP Connection to OracleConnection

Compile fail or run-time fail?

If compile fail - you need a nightly of dbcp.
If run-time fail, you may need to use getInnermostDelegate() instead

-Tim

Chakravarthy, Sundar wrote:
 I tried the following with no success,
 
 1. PoolableConnection pc = (PoolableConnection)conn;
 2. OracleConnection oc = (OracleConnection)pc.getDelegate();
 
 Fails in line 2
 
 -Sundar
 
 
 -Original Message-
 From: Tim Funk [mailto:[EMAIL PROTECTED] 
 Sent: Monday, March 31, 2003 10:34 AM
 To: Tomcat Users List
 Subject: Re: Casting DBCP Connection to OracleConnection
 
 All dbcp objects have a getDelegate() method (I think). But you'll
need 
 to do 2 casts.
 - dbcpConn = (DBCPClassCast)conn-- The dbcp connection
 - myOraConn = (OraClassCast)dbcpConn.getDelegate() -- Get the 
 underlying implementation
 
 Look at the DBCP javadocs for the correct class names.
 
 BUT you'll need to use a nightly build of dbcp to do this since the 
 version shipped with tomcat doesn't have the getDeletgate() methods.
 
 -Tim
 
 Marco Rossi wrote:
 
I have the same problem. If you find a solution, please reply



HI,

I am using Tomcat 4.1.18 with Oracle 9i. When I try to cast the
Connection returned from DBCP to OracleConnection I get a
ClassCastException .

Anyone here know how to cast correctly ?

Thanks

 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[OT] Re: Casting DBCP Connection to OracleConnection

2003-03-31 Thread Tim Funk
What kind of run-time failure? Is it a class-cast exception? If so what 
is the exception?

-Tim

Chakravarthy, Sundar wrote:
Run-time failure using both getInnermostDelegate() and getDelegate().
Any other alternatives ? 

-Sundar

-Original Message-
From: Tim Funk [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 31, 2003 10:49 AM
To: Tomcat Users List
Subject: Re: Casting DBCP Connection to OracleConnection

Compile fail or run-time fail?

If compile fail - you need a nightly of dbcp.
If run-time fail, you may need to use getInnermostDelegate() instead
-Tim



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: [OT] Re: Casting DBCP Connection to OracleConnection

2003-03-31 Thread Chakravarthy, Sundar
Here is part of the stacktrace ,

2003-03-31 10:47:41 Exception -
SearchInventory:doSearch()java.lang.ClassCastException
java.lang.ClassCastException
at
doas.inventory.SearchInventory.doSearch(SearchInventory.java:189)
at
org.apache.jsp.search_inventory_jsp._jspService(search_inventory_jsp.
java:351)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
.java:204)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:2
95)
at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDisp
atcher.java:684)
at
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationD
ispatcher.java:575)
at
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDis
patcher.java:498)
at
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary
.java:822)
at org.apache.jsp.main_jsp._jspService(main_jsp.java:282)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
.java:204)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:2
95)
at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:247)

-Sundar


-Original Message-
From: Tim Funk [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 31, 2003 11:02 AM
To: Tomcat Users List
Subject: [OT] Re: Casting DBCP Connection to OracleConnection

What kind of run-time failure? Is it a class-cast exception? If so what 
is the exception?

-Tim

Chakravarthy, Sundar wrote:
 Run-time failure using both getInnermostDelegate() and getDelegate().
 Any other alternatives ? 
 
 -Sundar
 
 -Original Message-
 From: Tim Funk [mailto:[EMAIL PROTECTED] 
 Sent: Monday, March 31, 2003 10:49 AM
 To: Tomcat Users List
 Subject: Re: Casting DBCP Connection to OracleConnection
 
 Compile fail or run-time fail?
 
 If compile fail - you need a nightly of dbcp.
 If run-time fail, you may need to use getInnermostDelegate() instead
 
 -Tim
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Casting DBCP Connection to OracleConnection

2003-03-31 Thread Filip Hanik
hi Sundar,
as an alternative, why don't you print the class names to know what you are
doing

for example

System.out.println(delegate=+conn.getDelegate().getClass().getName());

and do that for all of the things you try to cast, that way you can see what
you are accessing before you try to cast it

Filip

 -Original Message-
 From: Chakravarthy, Sundar [mailto:[EMAIL PROTECTED]
 Sent: Monday, March 31, 2003 7:57 AM
 To: Tomcat Users List
 Subject: RE: Casting DBCP Connection to OracleConnection



 Run-time failure using both getInnermostDelegate() and getDelegate().
 Any other alternatives ?

 -Sundar

 -Original Message-
 From: Tim Funk [mailto:[EMAIL PROTECTED]
 Sent: Monday, March 31, 2003 10:49 AM
 To: Tomcat Users List
 Subject: Re: Casting DBCP Connection to OracleConnection

 Compile fail or run-time fail?

 If compile fail - you need a nightly of dbcp.
 If run-time fail, you may need to use getInnermostDelegate() instead

 -Tim

 Chakravarthy, Sundar wrote:
  I tried the following with no success,
 
  1. PoolableConnection pc = (PoolableConnection)conn;
  2. OracleConnection oc = (OracleConnection)pc.getDelegate();
 
  Fails in line 2
 
  -Sundar
 
 
  -Original Message-
  From: Tim Funk [mailto:[EMAIL PROTECTED]
  Sent: Monday, March 31, 2003 10:34 AM
  To: Tomcat Users List
  Subject: Re: Casting DBCP Connection to OracleConnection
 
  All dbcp objects have a getDelegate() method (I think). But you'll
 need
  to do 2 casts.
  - dbcpConn = (DBCPClassCast)conn-- The dbcp connection
  - myOraConn = (OraClassCast)dbcpConn.getDelegate() -- Get the
  underlying implementation
 
  Look at the DBCP javadocs for the correct class names.
 
  BUT you'll need to use a nightly build of dbcp to do this since the
  version shipped with tomcat doesn't have the getDeletgate() methods.
 
  -Tim
 
  Marco Rossi wrote:
 
 I have the same problem. If you find a solution, please reply
 
 
 
 HI,
 
 I am using Tomcat 4.1.18 with Oracle 9i. When I try to cast the
 Connection returned from DBCP to OracleConnection I get a
 ClassCastException .
 
 Anyone here know how to cast correctly ?
 
 Thanks
 
 
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Casting DBCP Connection to OracleConnection

2003-03-31 Thread Chakravarthy, Sundar
Strange .. the getDelegate().getClass().getName() returns
oracle.jdbc.driver.OracleConnection . But the cast fails at runtime.

Sundar

-Original Message-
From: Filip Hanik [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 31, 2003 11:05 AM
To: Tomcat Users List
Subject: RE: Casting DBCP Connection to OracleConnection

hi Sundar,
as an alternative, why don't you print the class names to know what you
are
doing

for example

System.out.println(delegate=+conn.getDelegate().getClass().getName());

and do that for all of the things you try to cast, that way you can see
what
you are accessing before you try to cast it

Filip

 -Original Message-
 From: Chakravarthy, Sundar [mailto:[EMAIL PROTECTED]
 Sent: Monday, March 31, 2003 7:57 AM
 To: Tomcat Users List
 Subject: RE: Casting DBCP Connection to OracleConnection



 Run-time failure using both getInnermostDelegate() and getDelegate().
 Any other alternatives ?

 -Sundar

 -Original Message-
 From: Tim Funk [mailto:[EMAIL PROTECTED]
 Sent: Monday, March 31, 2003 10:49 AM
 To: Tomcat Users List
 Subject: Re: Casting DBCP Connection to OracleConnection

 Compile fail or run-time fail?

 If compile fail - you need a nightly of dbcp.
 If run-time fail, you may need to use getInnermostDelegate() instead

 -Tim

 Chakravarthy, Sundar wrote:
  I tried the following with no success,
 
  1. PoolableConnection pc = (PoolableConnection)conn;
  2. OracleConnection oc = (OracleConnection)pc.getDelegate();
 
  Fails in line 2
 
  -Sundar
 
 
  -Original Message-
  From: Tim Funk [mailto:[EMAIL PROTECTED]
  Sent: Monday, March 31, 2003 10:34 AM
  To: Tomcat Users List
  Subject: Re: Casting DBCP Connection to OracleConnection
 
  All dbcp objects have a getDelegate() method (I think). But you'll
 need
  to do 2 casts.
  - dbcpConn = (DBCPClassCast)conn-- The dbcp connection
  - myOraConn = (OraClassCast)dbcpConn.getDelegate() -- Get the
  underlying implementation
 
  Look at the DBCP javadocs for the correct class names.
 
  BUT you'll need to use a nightly build of dbcp to do this since the
  version shipped with tomcat doesn't have the getDeletgate() methods.
 
  -Tim
 
  Marco Rossi wrote:
 
 I have the same problem. If you find a solution, please reply
 
 
 
 HI,
 
 I am using Tomcat 4.1.18 with Oracle 9i. When I try to cast the
 Connection returned from DBCP to OracleConnection I get a
 ClassCastException .
 
 Anyone here know how to cast correctly ?
 
 Thanks
 
 
 
 
 
-
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
-
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Casting DBCP Connection to OracleConnection - Solved IT!

2003-03-31 Thread Chakravarthy, Sundar
I was using ojdbc_g.jar instead of classes12.zip ( i.e classes12.jar )

Sundar

-Original Message-
From: Chakravarthy, Sundar 
Sent: Monday, March 31, 2003 11:11 AM
To: Tomcat Users List
Subject: RE: Casting DBCP Connection to OracleConnection

Strange .. the getDelegate().getClass().getName() returns
oracle.jdbc.driver.OracleConnection . But the cast fails at runtime.

Sundar

-Original Message-
From: Filip Hanik [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 31, 2003 11:05 AM
To: Tomcat Users List
Subject: RE: Casting DBCP Connection to OracleConnection

hi Sundar,
as an alternative, why don't you print the class names to know what you
are
doing

for example

System.out.println(delegate=+conn.getDelegate().getClass().getName());

and do that for all of the things you try to cast, that way you can see
what
you are accessing before you try to cast it

Filip

 -Original Message-
 From: Chakravarthy, Sundar [mailto:[EMAIL PROTECTED]
 Sent: Monday, March 31, 2003 7:57 AM
 To: Tomcat Users List
 Subject: RE: Casting DBCP Connection to OracleConnection



 Run-time failure using both getInnermostDelegate() and getDelegate().
 Any other alternatives ?

 -Sundar

 -Original Message-
 From: Tim Funk [mailto:[EMAIL PROTECTED]
 Sent: Monday, March 31, 2003 10:49 AM
 To: Tomcat Users List
 Subject: Re: Casting DBCP Connection to OracleConnection

 Compile fail or run-time fail?

 If compile fail - you need a nightly of dbcp.
 If run-time fail, you may need to use getInnermostDelegate() instead

 -Tim

 Chakravarthy, Sundar wrote:
  I tried the following with no success,
 
  1. PoolableConnection pc = (PoolableConnection)conn;
  2. OracleConnection oc = (OracleConnection)pc.getDelegate();
 
  Fails in line 2
 
  -Sundar
 
 
  -Original Message-
  From: Tim Funk [mailto:[EMAIL PROTECTED]
  Sent: Monday, March 31, 2003 10:34 AM
  To: Tomcat Users List
  Subject: Re: Casting DBCP Connection to OracleConnection
 
  All dbcp objects have a getDelegate() method (I think). But you'll
 need
  to do 2 casts.
  - dbcpConn = (DBCPClassCast)conn-- The dbcp connection
  - myOraConn = (OraClassCast)dbcpConn.getDelegate() -- Get the
  underlying implementation
 
  Look at the DBCP javadocs for the correct class names.
 
  BUT you'll need to use a nightly build of dbcp to do this since the
  version shipped with tomcat doesn't have the getDeletgate() methods.
 
  -Tim
 
  Marco Rossi wrote:
 
 I have the same problem. If you find a solution, please reply
 
 
 
 HI,
 
 I am using Tomcat 4.1.18 with Oracle 9i. When I try to cast the
 Connection returned from DBCP to OracleConnection I get a
 ClassCastException .
 
 Anyone here know how to cast correctly ?
 
 Thanks
 
 
 
 
 
-
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
-
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Casting DBCP Connection to OracleConnection - Solved IT!

2003-03-31 Thread Marco Rossi
Where do you find ojdbc_g.jar?

I was using ojdbc_g.jar instead of classes12.zip ( i.e classes12.jar )

Sundar

-Original Message-
From: Chakravarthy, Sundar 
Sent: Monday, March 31, 2003 11:11 AM
To: Tomcat Users List
Subject: RE: Casting DBCP Connection to OracleConnection

Strange .. the getDelegate().getClass().getName() returns
oracle.jdbc.driver.OracleConnection . But the cast fails at runtime.

Sundar

-Original Message-
From: Filip Hanik [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 31, 2003 11:05 AM
To: Tomcat Users List
Subject: RE: Casting DBCP Connection to OracleConnection

hi Sundar,
as an alternative, why don't you print the class names to know what you
are
doing

for example

System.out.println(delegate=+conn.getDelegate().getClass().getName());

and do that for all of the things you try to cast, that way you can see
what
you are accessing before you try to cast it

Filip

 -Original Message-
 From: Chakravarthy, Sundar [mailto:[EMAIL PROTECTED]
 Sent: Monday, March 31, 2003 7:57 AM
 To: Tomcat Users List
 Subject: RE: Casting DBCP Connection to OracleConnection



 Run-time failure using both getInnermostDelegate() and getDelegate().
 Any other alternatives ?

 -Sundar

 -Original Message-
 From: Tim Funk [mailto:[EMAIL PROTECTED]
 Sent: Monday, March 31, 2003 10:49 AM
 To: Tomcat Users List
 Subject: Re: Casting DBCP Connection to OracleConnection

 Compile fail or run-time fail?

 If compile fail - you need a nightly of dbcp.
 If run-time fail, you may need to use getInnermostDelegate() instead

 -Tim

 Chakravarthy, Sundar wrote:
  I tried the following with no success,
 
  1. PoolableConnection pc = (PoolableConnection)conn;
  2. OracleConnection oc = (OracleConnection)pc.getDelegate();
 
  Fails in line 2
 
  -Sundar
 
 
  -Original Message-
  From: Tim Funk [mailto:[EMAIL PROTECTED]
  Sent: Monday, March 31, 2003 10:34 AM
  To: Tomcat Users List
  Subject: Re: Casting DBCP Connection to OracleConnection
 
  All dbcp objects have a getDelegate() method (I think). But you'll
 need
  to do 2 casts.
  - dbcpConn = (DBCPClassCast)conn-- The dbcp connection
  - myOraConn = (OraClassCast)dbcpConn.getDelegate() -- Get the
  underlying implementation
 
  Look at the DBCP javadocs for the correct class names.
 
  BUT you'll need to use a nightly build of dbcp to do this since the
  version shipped with tomcat doesn't have the getDeletgate() methods.
 
  -Tim
 
  Marco Rossi wrote:
 
 I have the same problem. If you find a solution, please reply
 
 
 
 HI,
 
 I am using Tomcat 4.1.18 with Oracle 9i. When I try to cast the
 Connection returned from DBCP to OracleConnection I get a
 ClassCastException .
 
 Anyone here know how to cast correctly ?
 
 Thanks
 
 
 
 
 
-
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
-
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Casting DBCP Connection to OracleConnection - Solved IT!

2003-03-31 Thread Chakravarthy, Sundar
In my tomcat common/lib; apparently it is the debug version of Oracle's
jdbc implentation. Download classes12.zip ( and rename to classes12.jar
) from Oracle site.

Sundar

-Original Message-
From: Marco Rossi [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 31, 2003 11:25 AM
To: Tomcat Users List
Subject: RE: Casting DBCP Connection to OracleConnection - Solved IT!

Where do you find ojdbc_g.jar?

I was using ojdbc_g.jar instead of classes12.zip ( i.e classes12.jar )

Sundar

-Original Message-
From: Chakravarthy, Sundar 
Sent: Monday, March 31, 2003 11:11 AM
To: Tomcat Users List
Subject: RE: Casting DBCP Connection to OracleConnection

Strange .. the getDelegate().getClass().getName() returns
oracle.jdbc.driver.OracleConnection . But the cast fails at runtime.

Sundar

-Original Message-
From: Filip Hanik [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 31, 2003 11:05 AM
To: Tomcat Users List
Subject: RE: Casting DBCP Connection to OracleConnection

hi Sundar,
as an alternative, why don't you print the class names to know what you
are
doing

for example

System.out.println(delegate=+conn.getDelegate().getClass().getName())
;

and do that for all of the things you try to cast, that way you can see
what
you are accessing before you try to cast it

Filip

 -Original Message-
 From: Chakravarthy, Sundar [mailto:[EMAIL PROTECTED]
 Sent: Monday, March 31, 2003 7:57 AM
 To: Tomcat Users List
 Subject: RE: Casting DBCP Connection to OracleConnection



 Run-time failure using both getInnermostDelegate() and getDelegate().
 Any other alternatives ?

 -Sundar

 -Original Message-
 From: Tim Funk [mailto:[EMAIL PROTECTED]
 Sent: Monday, March 31, 2003 10:49 AM
 To: Tomcat Users List
 Subject: Re: Casting DBCP Connection to OracleConnection

 Compile fail or run-time fail?

 If compile fail - you need a nightly of dbcp.
 If run-time fail, you may need to use getInnermostDelegate() instead

 -Tim

 Chakravarthy, Sundar wrote:
  I tried the following with no success,
 
  1. PoolableConnection pc = (PoolableConnection)conn;
  2. OracleConnection oc = (OracleConnection)pc.getDelegate();
 
  Fails in line 2
 
  -Sundar
 
 
  -Original Message-
  From: Tim Funk [mailto:[EMAIL PROTECTED]
  Sent: Monday, March 31, 2003 10:34 AM
  To: Tomcat Users List
  Subject: Re: Casting DBCP Connection to OracleConnection
 
  All dbcp objects have a getDelegate() method (I think). But you'll
 need
  to do 2 casts.
  - dbcpConn = (DBCPClassCast)conn-- The dbcp connection
  - myOraConn = (OraClassCast)dbcpConn.getDelegate() -- Get the
  underlying implementation
 
  Look at the DBCP javadocs for the correct class names.
 
  BUT you'll need to use a nightly build of dbcp to do this since the
  version shipped with tomcat doesn't have the getDeletgate()
methods.
 
  -Tim
 
  Marco Rossi wrote:
 
 I have the same problem. If you find a solution, please reply
 
 
 
 HI,
 
 I am using Tomcat 4.1.18 with Oracle 9i. When I try to cast the
 Connection returned from DBCP to OracleConnection I get a
 ClassCastException .
 
 Anyone here know how to cast correctly ?
 
 Thanks
 
 
 
 
 
-
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail:
[EMAIL PROTECTED]
 
 
 
-
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail:
[EMAIL PROTECTED]
 
 
 


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Casting DBCP Connection to OracleConnection - Solved IT!

2003-03-31 Thread Marco Rossi
I'm sorry, but i think to have an old release of commons-dbcp.jar, and i don't' find 
the getDelegate() method. It's in org.apache.commons.dbcp.PoolableConnection class??

In my tomcat common/lib; apparently it is the debug version of Oracle's
jdbc implentation. Download classes12.zip ( and rename to classes12.jar
) from Oracle site.

Sundar

-Original Message-
From: Marco Rossi [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 31, 2003 11:25 AM
To: Tomcat Users List
Subject: RE: Casting DBCP Connection to OracleConnection - Solved IT!

Where do you find ojdbc_g.jar?

I was using ojdbc_g.jar instead of classes12.zip ( i.e classes12.jar )

Sundar

-Original Message-
From: Chakravarthy, Sundar 
Sent: Monday, March 31, 2003 11:11 AM
To: Tomcat Users List
Subject: RE: Casting DBCP Connection to OracleConnection

Strange .. the getDelegate().getClass().getName() returns
oracle.jdbc.driver.OracleConnection . But the cast fails at runtime.

Sundar

-Original Message-
From: Filip Hanik [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 31, 2003 11:05 AM
To: Tomcat Users List
Subject: RE: Casting DBCP Connection to OracleConnection

hi Sundar,
as an alternative, why don't you print the class names to know what you
are
doing

for example

System.out.println(delegate=+conn.getDelegate().getClass().getName())
;

and do that for all of the things you try to cast, that way you can see
what
you are accessing before you try to cast it

Filip

 -Original Message-
 From: Chakravarthy, Sundar [mailto:[EMAIL PROTECTED]
 Sent: Monday, March 31, 2003 7:57 AM
 To: Tomcat Users List
 Subject: RE: Casting DBCP Connection to OracleConnection



 Run-time failure using both getInnermostDelegate() and getDelegate().
 Any other alternatives ?

 -Sundar

 -Original Message-
 From: Tim Funk [mailto:[EMAIL PROTECTED]
 Sent: Monday, March 31, 2003 10:49 AM
 To: Tomcat Users List
 Subject: Re: Casting DBCP Connection to OracleConnection

 Compile fail or run-time fail?

 If compile fail - you need a nightly of dbcp.
 If run-time fail, you may need to use getInnermostDelegate() instead

 -Tim

 Chakravarthy, Sundar wrote:
  I tried the following with no success,
 
  1. PoolableConnection pc = (PoolableConnection)conn;
  2. OracleConnection oc = (OracleConnection)pc.getDelegate();
 
  Fails in line 2
 
  -Sundar
 
 
  -Original Message-
  From: Tim Funk [mailto:[EMAIL PROTECTED]
  Sent: Monday, March 31, 2003 10:34 AM
  To: Tomcat Users List
  Subject: Re: Casting DBCP Connection to OracleConnection
 
  All dbcp objects have a getDelegate() method (I think). But you'll
 need
  to do 2 casts.
  - dbcpConn = (DBCPClassCast)conn-- The dbcp connection
  - myOraConn = (OraClassCast)dbcpConn.getDelegate() -- Get the
  underlying implementation
 
  Look at the DBCP javadocs for the correct class names.
 
  BUT you'll need to use a nightly build of dbcp to do this since the
  version shipped with tomcat doesn't have the getDeletgate()
methods.
 
  -Tim
 
  Marco Rossi wrote:
 
 I have the same problem. If you find a solution, please reply
 
 
 
 HI,
 
 I am using Tomcat 4.1.18 with Oracle 9i. When I try to cast the
 Connection returned from DBCP to OracleConnection I get a
 ClassCastException .
 
 Anyone here know how to cast correctly ?
 
 Thanks
 
 
 
 
 
-
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail:
[EMAIL PROTECTED]
 
 
 
-
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail:
[EMAIL PROTECTED]
 
 
 


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]