jQuery in Action, 2nd edition*
The moose likes Websphere and the fly likes Please help with DataSource problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "Please help with DataSource problem" Watch "Please help with DataSource problem" New topic

Please help with DataSource problem

Huiming Gu

Joined: May 16, 2001
Posts: 13
Problem: I try to set up JDBC driver and DataSource for oracle. After setted up I use a servlet to test the connection. But I get the following error:
"exception in initjava.sql.SQLException:No suitable driver"
Background Info:
WAS used: 4.00 Advanced Single server developer edition
ORACLE used: Enterprise edition
Both WAS and ORACLE run on the same machine(WIN2000 Professional)
I can access the ORACLE using regular java application after setting classpath to "classes12.zip"
servlet Code:
...servlet intialize.....
InitialContext initialcontext = new InitialContext();
out.println("before Data Source");
DataSource datasource = (DataSource)initialcontext.lookup("jdbc/orcl");
out.print("after Datasource");
Connection connection = datasource.getConnection("system","manager");
out.print("after connection");
...end servlet.....

In the browser I can see the output of "after Datasource". Which means there are no problem in JNDI binding.
In the browser I can not see the output of "after connection". Which means the problem happened in the connection to database.
The error is:"exception in initjava.sql.SQLException:No suitable driver"
JDBC driver Setting:
Server Class Path:${WAS_ROOT}\lib\classes12.zip (I also tried ${WAS_ROOT}/lib/classes12.zip, but it not work either)
Name: OracleJdbcDriver
Description: Oracle JDBC Driver
Implementation classname: oracle.jdbc.pool.OracleConnectionPoolDataSource
Data Sources Setting:
Name: oracleORCL
JNDI Name: jdbc/orcl
Default User ID: system
Default Password: *******
J2EE Resource Provider: OracleJdbcDriver
Resource Properties Setting:
Name: URL
Type: java.lang.String
Value: jdbc.oracle.thin:@IPAddress:1521 rcl
BTW: I restart the server every time I changed the settings. I tried the JDBC driver that come with ORACLE and the newest JDBC driver download from ORACLE. Both not work.
What could be wrong???
It drive me crazy for quite some time. I appreciate your help!!!

Disabled Smilies in this Post
[This message has been edited by Rahul Mahindrakar (edited September 25, 2001).]
Jun Hong
Ranch Hand

Joined: Sep 05, 2001
Posts: 181
Why not try to replace ${WAS_ROOT} with a real value. What if it is not defined?
Jun Hong

Jun Hong<br />SCJP, SCJD, SCWCD, SCEA<br />IBM Certified Systems Expert(V4.0)
Huiming Gu

Joined: May 16, 2001
Posts: 13
Actually, I tried both real path and ${WAS_ROOT}. Both does not work for me. I tried ${WAS_ROOT} is because I see the InstantDB Driver is setted with this.
Jun Hong
Ranch Hand

Joined: Sep 05, 2001
Posts: 181
Hi I think I found the problem:
Try to replace two .'s with :'s.
Jun Hong

[This message has been edited by Jun Hong (edited September 26, 2001).]
Huiming Gu

Joined: May 16, 2001
Posts: 13
Thanks so much Hong Jun.
This is exactly where the problem is. How stupid I am.
Jun Hong
Ranch Hand

Joined: Sep 05, 2001
Posts: 181
My pleasure.
I agree. Here's the link: http://aspose.com/file-tools
subject: Please help with DataSource problem
Similar Threads
jdbc driver problem
Unable to get connection, DataSource invalid: "java.sql.SQLException: No suitable driver"
WSAD specific directions for creating an Oracle Data Source
WSAD 4.0.3 Test Environment
Jboss 4.2.3 how to change the default datasource to oracle ?