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 connection url Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "connection url" Watch "connection url" New topic
Author

connection url

slava belenky
Greenhorn

Joined: Aug 14, 2001
Posts: 1
I need to open a java.sql.Connection to a database residing on a different computer. I tried everything similar to the following:
String url = "jdbcdbc://111.222.333.444/members"
Connection c = DriverManager.getConnection(url);
It keeps telling me can't find source. The database is registered; it's ms access. What's the correct way to write the url?
Stanley Tan
Ranch Hand

Joined: May 17, 2001
Posts: 243
Try changing your system DSN to point to the remote database and connect using the local system DSN.
Himanshu Khanna
Greenhorn

Joined: Aug 15, 2001
Posts: 29
What a coincidence ..I am facing the same problem..Just that the remote DB in my case is Personal Oracle Version 8.0.4.
First I tried using JDBC ODBC driver(sun.jdbc.odbc.JdbcOdbcDriver) . Here the run time error msg was -> java.sql.SQLException: [Microsoft][ODBC Driver Manager]Data source name or the established driver which is appointed are not found.
Than I moved to Oracle JDBC drive (oracle.jdbc.driver.OracleDriver).Now the run time error msg is ->java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
Kindly Help . I have to use Oracle driver as I believe they are faster than JDBC ODBC drivers.
Thanks
Stanley Tan
Ranch Hand

Joined: May 17, 2001
Posts: 243
Yup, it would be a lot faster to use the Oracle JDBC drivers. After obtaining the drivers, make sure that it is in your classpath so that the program can find it
Sunetra Saha
Ranch Hand

Joined: Feb 25, 2001
Posts: 77
I had a problem using the oracle jdbc driver with personal oracle too. But it works fine with the jdbc-odbc driver.
Himanshu Khanna
Greenhorn

Joined: Aug 15, 2001
Posts: 29
Thanks Stanley ..but U see I have the entry in the classpath too .
My environmental variable , path , is ,
E:\ORANT\bin;e:\orant\oracle/jdbc/lib/classes111.zip;c:\jdk1.3.0_02\bin;
but still the error , java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver is persisting .
Please suggest a way out as this problem is eating me up like anything..I have spent a whole day on it but couldn't find a solution!!
john_guthrie
Greenhorn

Joined: Jun 14, 2001
Posts: 16
Note that you state that you have your PATH (not CLASSPATH) set to include classes111.zip - make sure its CLASSPATH. Also, you can look in the ZIP file to make sure the driver that is being complained about is really there.
Stanley Tan
Ranch Hand

Joined: May 17, 2001
Posts: 243
>java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
this means that somehow, for some reason, it can't find the right classes. Maybe you should get the latest JDBC drivers for Oracle off their web site and try adding them to your JDK\jre\lib\ext directory. Or trying putting the drivers you have right now in the said directory and see if it works
[This message has been edited by Stanley Tan (edited August 15, 2001).]
Himanshu Khanna
Greenhorn

Joined: Aug 15, 2001
Posts: 29
John , Stanley , Thanks a lot !
John U were right abt the CLASSPATH (and not PATH)
I edited the CLASSPATH & added e:\orant\jdbc\lib\classes111.zip;
Now the driver is being located ..smooth !!
The Connection is also established !!!
Thanks once again
cardwell cupp
Ranch Hand

Joined: Aug 16, 2001
Posts: 66
belenky,
I am actually having the exact same problem.
The only thing that I could find on the subject is:
the url is should look like this
jdbc dbc://hostname ort/subsubname
I don't see a port on yours...could that be the problem?
Then again, I am getting the same exception so, it may not be correct.
Cardwell

cardwell cupp
Ranch Hand

Joined: Aug 16, 2001
Posts: 66
Sorry about the smilies
'jdbc: odbc://1111.2222.3333: port/whateverDatabase
ignore the spaces in the url
Thanks
Cardwell
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: connection url
 
Similar Threads
Asynchronously update of the FFM
how i get an empty resultSet when there is a data ?
DriverManager class
configuring datasource in struts-config.xml
Connection object in context listenter