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).]
Jun Hong
Ranch Hand
Joined: Sep 05, 2001
Posts: 181
posted
0
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
Greenhorn
Joined: May 16, 2001
Posts: 13
posted
0
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
posted
0
Hi I think I found the problem: jdbc.oracle.thin:@ Try to replace two .'s with :'s. Jun Hong
[This message has been edited by Jun Hong (edited September 26, 2001).]
Huiming Gu
Greenhorn
Joined: May 16, 2001
Posts: 13
posted
0
Thanks so much Hong Jun. This is exactly where the problem is. How stupid I am.