This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Oracle Connectivity Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Oracle Connectivity Error" Watch "Oracle Connectivity Error" New topic
Author

Oracle Connectivity Error

asheesh talwar
Ranch Hand

Joined: Dec 10, 2000
Posts: 31
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

Joined: Mar 06, 2001
Posts: 26
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

Joined: Nov 07, 2000
Posts: 621
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

Joined: Dec 10, 2000
Posts: 31
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
 
wood burning stoves
 
subject: Oracle Connectivity Error
 
Similar Threads
SQL Server 2000 JDBC Driver Error
SQLException: invalid arguments in call??
PROBLEMS IN CONNECTING TO ORACLE
JDBC/Oracle access problem
SQLException: invalid arguments in call??