aspose file tools*
The moose likes JDBC and the fly likes Unable to cast preparestatement of weblogic6.1 to oracleprpepared statement Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Unable to cast preparestatement of weblogic6.1 to oracleprpepared statement" Watch "Unable to cast preparestatement of weblogic6.1 to oracleprpepared statement" New topic
Author

Unable to cast preparestatement of weblogic6.1 to oracleprpepared statement

Saravanan Alagu
Greenhorn

Joined: Oct 08, 2005
Posts: 5
Group,

Am facing typical problem in casting prepared statement to oracleprepared statement. Inorder to provide multilingual support in one of our project, we followed the database type conversion for unicode support (changing varchar2 to nvarchar2). I guess setFormOfUse() in oracle prepared statement have to be used for any inserts in column of type NVARCHAR2. My application is running in weblogic6.1 and uses oracle thin driver. In code, when prepared statement is casted to oraclepreparedstatement classcastexception is thrown. Looks like weblogic8.1 supports this conversion. Any idea how to eliinate this issue in weblogic6.1.

Thanks in advance
Maximilian Xavier Stocker
Ranch Hand

Joined: Sep 20, 2005
Posts: 381
The weblogic version difference is a misnomer. You are getting a class cast exception because it isn't an Oracle prepared statement.

Why would that be?

1) Perhaps the use of different driver?

2) Check what other environment aka classpath differences there are between the one that works and the one that doesn't.
Saravanan Alagu
Greenhorn

Joined: Oct 08, 2005
Posts: 5
Hi

Looks like no issue in classpath. Probably choice of driver could be different for oracle extension classes. I put mmy question this way, how do i use oracle extension classes in weblogic6.1 to insert unicode characters. Your suggestion is very much valuable and appreciated.

Thanks
Saran
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

In the days of Weblogic 6.1, BEA provided their own Oracle Driver. ie you are trying to cast the BEA driver to an Oracle driver, and this is not going to work.
Saravanan Alagu
Greenhorn

Joined: Oct 08, 2005
Posts: 5
David

Do you know how this will work? If i use JDriver in weblogic, will it solve the problem.

Thanks
Saran
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

I'm not sure, unfortunately.
I'm sure we were using the (oracle provided) Oracle driver at one stage, but I can't remember what we needed to change.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to cast preparestatement of weblogic6.1 to oracleprpepared statement