No suitable driver found for jdbc:oracle:oci:@

Hello, I am able to compile my java program and run it. But =if I create an executable jar

and try to run it I get an error - No suitable driver found for jdbc:oracle:oci:@.

The classpath = .;C:\oracle\ora92\jdbc\lib\ojdbc14.jar;;C:\oracle\ora92\jdbc\lib\ojdbc14.jar;C:\Program Files\Java\jdk1.6.0\bin;C:\Program Files\Java\jre1.6.0_01\bin

I load the driver using this code.

//load the oracle JDBC Driver.

Class.forName("oracle.jdbc.driver.OracleDriver");

And try to get a connection using this code

conn = DriverManager.getConnection("jdbc:oracle:oci:@", userIdTextField.getText(), PasswordField.getText() );

I have tried classes11 and classes12 jar files but same error.

I get the same error if I set the classpath at run time with -classpath.

Any ideas or suggestions would be a great help. I have been trying to solve this for 2 days.

Thanks

Sami

[929 byte] By [samidurrania] at [2007-11-27 7:29:00]
# 1

jdbc:oracle:oci:@ is not a full connect string. It needs the host, port, and instance - like jdbc:oracle:oci:@myhost:1521:inst1.

See http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.htm#05_04

Also, oracle.jdbc.driver package is deprecated. It will work through version Oracle 10.2, which is fine for now, but eventually you'll need to change to "orcale.jdbc" package. e.g. "oracle.jdbc.OracleDriver" instead of "oracle.jdbc.driver.OracleDriver". http://forums.oracle.com/forums/ann.jspa?annID=201

Jemiah

fishninja007a at 2007-7-12 19:09:10 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...