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: 8.1.6.0.0 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..... Result: 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).]