File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes DriverManager.getConnection( Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "DriverManager.getConnection("...","user","password");" Watch "DriverManager.getConnection("...","user","password");" New topic
Author

DriverManager.getConnection("...","user","password");

Jeff Grant
Ranch Hand

Joined: Dec 19, 2001
Posts: 169
Connection con = DriverManager.getConnection(url,"user","password");
My computer name is laptop running the Oracle 8i Database on Port 1521. My Database name is "POS".
For url, I tried...
url = "jdbc racle:@POS:1521:POS";
url = "jdbc racle:@POS.domain:1521:POS";
url = "jdbc racle:@POS.domain:1521:POS.domain";
url = "jdbc racle:@POS:1521:POS.domain";
I do have the Listener running. My SID is set to POS and my global db name is POS.domain.
How can I check to ensure that I am right using Oracle 8i under Windows 2k? I am almost positive that I am correct though from when I setup the database to begin with.
This is running off of my local machine right now, but when I am done writing the program, it will be used from other machines off of one server.
Am I correct in the assumption that the Catch function is called if the database connection is not established? Becuase, right now, it is being executed.
[This message has been edited by Jeff Grant (edited December 20, 2001).]
simon wang
Greenhorn

Joined: Dec 20, 2001
Posts: 1
how about your ServiceName?

------------------
Jeff Grant
Ranch Hand

Joined: Dec 19, 2001
Posts: 169
Originally posted by simon wang:
how about your ServiceName?

Sorry, but what is that? I am running Oracle 8i under Windows 2k... I am not sure what you mean by a service name.
Arun Vethadas .T
Ranch Hand

Joined: Dec 13, 2001
Posts: 36
url="jdbc dbc:servicename"
eg,

"jdbc dbc ra7"
"jdbc bdc:world"
servicename is in ur sql plus or oracle login form.
scott
tiger
"......." this ur service name.
try. all the best.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: DriverManager.getConnection("...","user","password");