----- Original Message -----
Sent: Tuesday, July 31, 2001 11:23 AM
Subject: Re: about JDBC
Is
your driver name right?
I
think it's
sun.jdbc.odbc.JdbcOdbcDriver
and
not
sun.java.odbc.JdbcOdbcDriver
pb
hi everybody.
I have one question of jdbc.
the code is here:
......
String
driverName="sun.java.odbc.JdbcOdbcDriver";
String
connectionURL="jdbc:odbc:107";//the ODBC dsn is 107
Connection con=null;
Statement stmt=null;
String sqlStatement="SELECT
CHANNEL_ID,MPHONENO,MCC_ID,ZSMPHONENO FROM
M_SMS_DISTRIBUTION_LIST";
ResultSet rs=null;
try{
/*
* register jdbc
class
* where the error
happened
*/
Class.forName(driverName);
con=DriverManager.getConnection(connectionURL);
stmt=con.createStatement();
rs=stmt.executeQuery(sqlStatement);
there is always a exception throws when register jdbc class
.
The exception information is:
java.lang.ClassNotFoundException:
sun.java.odbc.JdbcOdbcDriver
at
java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native
Method)
at
java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at
java.lang.ClassLoader.loadClass(ClassLoader.java:297)
at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
at
java.lang.ClassLoader.loadClass(ClassLoader.java:253)
at
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
at java.lang.Class.forName0(Native
Method)
at
java.lang.Class.forName(Class.java:120)
at
query.OraQuery.performQuery(OraQuery.java:42)
at
query.OraQuery.main(OraQuery.java:23)
I have set the classpath as c:\jdk1.3.1\lib, I think there
must be something else I should do.
but what's that?
thanks