• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

oracle jdbc driver for websphere

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
i try to deploy a webapp to ws 4.0 AE but the
server doesn't find the oracle jdbc driver
i set the system classpath to point to the
class12.zip file
can anyone pls tell me what to do?
i searched the on line docs and there was something that one can configure it with the
administration console, but i am not an admin
so i was a bit confused with that
thx a lot
gergo
 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi gergo,
You should use classes12.zip
and
Implementation class should be
"oracle.jdbc.pool.OracleConnectionPoolDataSource"
This has to be mentioned in your application. To do that you have to start the server administration console, there you can see you application. Click on your application and go to your datasource node and add the above implementation class. Then It will work.
Cheers,
Shanmugam.
 
Gergely Dombi
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi Shanmugam,
thx a lot it works now
by the way the whole connection stuff
is in a try-catch-finally block and
finally
{
conn.close();
}
caused a nullpointer exc
i commented it out and then it worked
is that something with websphere's connection
poooling?
thx you very much again
gergo
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is nothing wrong with WebSphere's connection pooling that would cause an NPE in connection.close() that I am aware of. Would you mind posting your entire section of code so that we could suggest other possible solutions?
Kyle
 
Gergely Dombi
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
here is the skeleton of the code:

//declarations earlier in an include file
//...
try{
Class.forName(driver);
conn = DriverManager.getConnection(url, username, password);
String query = "select ...";
statement = conn.createStatement();
rs = statement.executeQuery(query);
//bla-bla, i don't use conn here
}catch(ClassNotFoundException cnfe){
System.err.println("..." + cnfe);
}catch(SQLException sqle){
System.err.println("..." + sqle);
}finally{
conn.close();
}
And in the finally clause comes the NPE.
I thought it may be something misterious with was's connection pooling cause while i wrote and
tested the app with tomcat it was ok.
Actually as i commented out the conn.close()
it worked welll.
Can u explain this to me pls?I am really interested. THX a lot.
Gergo
 
Kyle Brown
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There's the problem -- it doesn't matter squat what you set up in the DataSource tab because you are NOT using DataSources in your code!
Don't use DriverManager in your code in J2EE, ever! Instead, use a DataSource as follows:
Replace
Class.forName(driver);
conn = DriverManager.getConnection(url, username, password);
with:
InitialContext ctx = new InitialContext();
DataSource ds = (DataSource) ctx.lookup("jdbc/mydatasource"); // your name will differ
Connection conn = ds.getConnection();
Kyle
[ January 13, 2003: Message edited by: Kyle Brown ]
 
Gergely Dombi
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi Kyle,
thank you for the tip
i am new to J2EE and ready to learn
new design patterns
i will look the up docs about DataSources
bye
Gergo
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I posted a note on Dec 31 Topic: Converting servlet to a WebSphere JDBC datasource. Is what's been described here applicable to my problem as well?
The code I'm trying to convert was also built for Tomcat but has it's own connection pool.
Any help would be appreciated. I'm still stuck.
Thanks
 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'd like to extend this thread to ask about some compatibility issues. I've got to access an Oracle 8.1.5 server & the driver supplied is in classes111.zip. There is no mention of DataSource support in the documentation and they say to load to driver via
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
I've got classes12.zip from Oracle 8.1.7 & assume the driver will connect to 8.1.5. S
 
Steve McCain
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'd like to extend this thread to ask about some compatibility issues. I've got to access an Oracle 8.1.5 server & the driver supplied is in classes111.zip. There is no mention of DataSource support in the 815 documentation and they say to load to driver via
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
I've got classes12.zip from Oracle 8.1.7 & assume the driver will connect to 8.1.5. I can try to use this in WAS 4.0 to create a DataSource. However I'm using VisualAge 4.0 for development &
the WTE datasource driver class for Oracle is
also oracle.jdbc.driver.OracleDriver not oracle.jdbc.pool.OracleConnectionPoolDataSource as mentioned by Shanmugan.
I'm wondering can I really create a datasource in VAJ using oracle.jdbc.driver.OracleDriver and if so which classesXX.zip should I use?
Also I could upgrade VAJ to WS Studio Site Developer - is the limitation of not being able to add new drivers to the WTE JNDI database fixed in this?
 
reply
    Bookmark Topic Watch Topic
  • New Topic