Win a copy of Learning Java by Building Android Games this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

Oracle and IBM WSAD JDBC issue-HELP!  RSS feed

 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using a DataAccessObject pattern. I discovered you can speed up your procesing with SELECT statments using an OraclePreparedStatment and setting defineColumnType; thereby reducing the number of trips the SQL is sent to the database.

Here is the code:

'ps' is a PreparedStatement.

However, at runtime, I am getting a class cast exception for the below reason. I am using WASD version 5.1.1. I was not aware IBM was using any specific classes in the JDBC drivers.


Could someone please explain this to me? Any help would be greatly appreciated.

Thanks in advance.

Russ

[edited so page doesn't scroll right]
[ May 24, 2005: Message edited by: Jeanne Boyarsky ]
 
Ranch Hand
Posts: 1085
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try with type casting you connection with oracleConenction and make sure that you have classes12.zip in your application classpath,


Shailesh
[ May 24, 2005: Message edited by: Shailesh Chandra ]
 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for offering a good suggestion. However, I did try it and it did not work. I am still getting the same error.
 
Shailesh Chandra
Ranch Hand
Posts: 1085
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you tell me what is Data Source helper class Name in your data source configuration ?
This class should be com.ibm.websphere.rsadapter.OracleDataStoreHelper

did you try with java program and a thin driver connection.just try without any datasource and check if code is correct.

Shailesh
[ May 24, 2005: Message edited by: Shailesh Chandra ]
 
Russ Ray
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you! The data source helper file is com.ibm.websphere.OracleDataStoreHelper. I think you are suggesting this should be changed, but to what? The only thing I see in the pulldown menu is ibm specific files for the different databases. Any suggestions?

Russ

Thank you again.........
 
Shailesh Chandra
Ranch Hand
Posts: 1085
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am not suggesting to change helper class rather i was confirming same.

did you check your code without datasource ?

Shailesh
 
Russ Ray
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much!!! I was not able to test the code until today. Getting an Oracle connection directly by not using the pooled DataSource proved the IBM class is not compatible with Oracle's suggestion.

I also noticed Oracle's suggestion was 15 millis slower than the current way we are executing the PreparedStatement.
 
Shailesh Chandra
Ranch Hand
Posts: 1085
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I searched on google and after a quick search it sounds that we can not use oracleConnection while using websphere's data source.however we can do same with driver manager

Shailesh
 
Russ Ray
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for all your help.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!