|
Is
your driver name right?
I
think it's
sun.jdbc.odbc.JdbcOdbcDriver
and
not
sun.java.odbc.JdbcOdbcDriver
pb
-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of bridges Sent: 31 July, 2001 8:39 AM To: [EMAIL PROTECTED] Subject: about JDBC 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
|
- About JDBC Alarcon Fabio
- Re: About JDBC Claude HONNORE
- Re: About JDBC Purav
- about JDBC bridges
- Re: about JDBC Peter Barraud
- Re: about JDBC M H Rao
- Re: about JDBC bridges
