• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Tom long
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Jamie Robertson
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you, Jamie.
 
Monty Ireland
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic