Home » RDBMS Server » Server Administration » JDBC question
JDBC question [message #50123] Fri, 01 March 2002 10:28 Go to next message
Chen Wen
Messages: 26
Registered: February 2002
Junior Member
How to connect to Oracle server by JDBC?
I tried by following codes, but failed.
1.
Driver driver =
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
DriverManager.registerDirver(driver);
Connection con =
DriverManager.getConnection("jdbc:oracle:oracle:@134.68.140.4:1521:orc
l","user","password");
2.
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con =
DriverManager.getConnection("jdbc:oracle:oracle:@134.68.140.4:1521:orc
l","user","password");
Re: JDBC question [message #50155 is a reply to message #50123] Mon, 04 March 2002 07:12 Go to previous message
dug
Messages: 7
Registered: March 2002
Junior Member
you need to register the oracle driver
the driver should be in classpath
(you can search the driver in your oracle_installationjdbclib directory which would normally be classes*.zip)
try this
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con =DriverManager.getConnection(url,username,password);

gracious
Previous Topic: very urgent..drop user username hangs..what to do..
Next Topic: How to reate new database with script in windows 2000
Goto Forum:
  


Current Time: Mon Jul 08 12:16:09 CDT 2024