• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

connection url

 
slava belenky
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try changing your system DSN to point to the remote database and connect using the local system DSN.
 
Himanshu Khanna
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
>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
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry about the smilies
'jdbc: odbc://1111.2222.3333: port/whateverDatabase
ignore the spaces in the url
Thanks
Cardwell
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic