SQLJ Exception in thread "main" java.sql.SQLException: No suitable driver
From: johnchen24 <ckq_backup_at_263.net>
Date: 30 Oct 2001 05:40:43 -0800
Message-ID: <e0deeb16.0110300540.649b7533_at_posting.google.com>
hello
import java.sql.*;
import oracle.sqlj.runtime.Oracle;
import sqlj.runtime.ref.DefaultContext;
# Users should uncomment one of the following URLs or add their own. sqlj.url=jdbc:oracle:thin:_at_localhost:1521:netedu #User name and password here
sqlj.user=scott
sqlj.password=tiger
Date: 30 Oct 2001 05:40:43 -0800
Message-ID: <e0deeb16.0110300540.649b7533_at_posting.google.com>
hello
Following is my code.
import java.sql.*;
import oracle.sqlj.runtime.Oracle;
import sqlj.runtime.ref.DefaultContext;
class TestInstallJDBC {
public static void main (String args[]) throws SQLException
{
Connection conn=null;;
PreparedStatement ps=null;
ResultSet rs=null;
Oracle.connect(TestInstallJDBC.class, "connect.properties");
System.out.println("Hello World!");
}
}
Following is the connect.properties
# Users should uncomment one of the following URLs or add their own. sqlj.url=jdbc:oracle:thin:_at_localhost:1521:netedu #User name and password here
sqlj.user=scott
sqlj.password=tiger
When I try to run the "java TestInstallJDBC"
The following exception is throwed.
Exception in thread "main" java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java:537) at java.sql.DriverManager.getConnection(DriverManager.java:177) at sqlj.runtime.ref.ConnectionContextImpl.<init>(ConnectionContextImpl.j ava:102) at sqlj.runtime.ref.DefaultContext.<init>(DefaultContext.java:142) at oracle.sqlj.runtime.Oracle.getConnection(Oracle.java:501) at oracle.sqlj.runtime.Oracle.getConnection(Oracle.java:901) at oracle.sqlj.runtime.Oracle.getConnection(Oracle.java:889) at oracle.sqlj.runtime.Oracle.getConnection(Oracle.java:713) at oracle.sqlj.runtime.Oracle.getConnection(Oracle.java:759) at oracle.sqlj.runtime.Oracle.connect(Oracle.java:374) at TestInstallJDBC.main(TestInstallJDBC.java:19)
Who can help me?
Thank you in advance!
John Chen Received on Tue Oct 30 2001 - 14:40:43 CET