Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Oracle Connectivity Error

 
asheesh talwar
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I run the following code I am getting this error
Can any one suggest where is the error & what is the best way to connect to oracle database using java.

(edited by Cindy to format code and turn off smilies.)

[This message has been edited by Cindy Glass (edited May 09, 2001).]
 
Bill Prentice
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The URL looks wrong, compare it to one of ours,
url = jdbc racle:thin:@ibms1:xxxx:dev3
where @ibms1 is the host server
xxxx is the port number
dev3 is the service name or sid
We do not include username and password since that is validated elsewhere but the form would be url - user - password.
Hope this helps

[This message has been edited by Cindy Glass (edited May 09, 2001).]
 
Sean MacLean
author
Ranch Hand
Posts: 621
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd also try a couple of extra catch statements. One around the Class.forName and one around the getConnection. This way you'll see if the problem is occuring because the driver is not loading properly (i.e. the Oracle dirvers are not in the class path or similar) or if the connection string is invalid. I suspect that it's the former.
Sean
 
asheesh talwar
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bill I tried the url that you have specified but now
also I am getting this error while running it.
modified connection(con)where assetdb is the host server,1521 port id & assetdb is SID.
con = DriverManager.getConnection("jdbc racle:thin:@assetdb:1521:assetdb","asset","tiger");
Now I am getting this error
SQL Exception caughtjava.sql.SQLException: assetdb
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic