wood burning stoves 2.0*
The moose likes JDBC and the fly likes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark ""No suitable driver"?? --when connect to oracle8 with jdbc, need help" Watch ""No suitable driver"?? --when connect to oracle8 with jdbc, need help" New topic
Author

"No suitable driver"?? --when connect to oracle8 with jdbc, need help

Tom long
Greenhorn

Joined: Apr 23, 2002
Posts: 7
hello, everyone.
I try to connect to oracle8 by jdbc like :
//Class.forName(oracle.jdbc.driver.OracleDriver);
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection conn = DriverManager.getConnection("jdbc.oracle.thin:@10.10.10.26:1521:mydata",user,passwd);
it show me: no suitable driver
I have checked the oracle's FAQ (http://otn.oracle.com/tech/java/sqlj_jdbc/htdocs/jdbc_faq.htm#_37_), it say need to registered the driver, I try it like the example of FAQ. but get the exception too.
I try to use another method to connect to oracle like :
Connection conn =DriverManager.getConnection("jdbc racle:thin:@(description=(address=(host=10.10.10.26)(protocol=tcp)(port=1521))(connect_data=(sid=mydata)))",user, passwd);
it works!!!
the second method using TNSNAMES to connect, any body can help me why the second works but the first cant?
How to make the first method works?
and what is TNSNAMES?
thank you
Tom
scjp


scjp2
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

you have a malformed URL in the first one. Change to --> replace the '.' between jdbc,oracle and thin to ':'.
Jamie
[ May 17, 2002: Message edited by: Jamie Robertson ]
Tom long
Greenhorn

Joined: Apr 23, 2002
Posts: 7
thank you, Jamie.
Monty Ireland
Ranch Hand

Joined: Oct 03, 2000
Posts: 161
Searh this form for code examples.
I have posted Oracle, DB2, CloudScape, and MS-Access examples.
Search this form for Monty or Monty6
Start you search around Sept of 2001
You may have to go back about 6 to 12 months.
Hope this helps


Multi Platform Database Developer & DBA on E.S.T.
 
 
subject: "No suitable driver"?? --when connect to oracle8 with jdbc, need help
 
Similar Threads
~~~ How to configre Java Web Server to access Oracle driver
URLClassLoader for loading JDBC driver...
java.lang.ClassCastException error
connection without DSN
JDBC Oracle connection...not working