| Author |
classnotfoundexception
|
satya narayan reddy
Greenhorn
Joined: Nov 26, 2005
Posts: 13
|
|
hi all, can anybody please fix why the below program is giving classnotfoundexception thanks in advance, satya import java.sql.*; import java.io.*; public class JDBCTest { public static void main(String args[]) { try { Class.forName("sun.jdbc.odbc.JDbcOdbcDriver"); Connection c = DriverManager.getConnection("jdbc dbc:venkatdsn"); Statement st = c.createStatement(); ResultSet rs =st.executeQuery("Select sno,sname from student"); try { while(rs.next()) { System.out.println(rs.getInt("sno")+":"); System.out.println(rs.getString("sname")); } } catch(Exception e) { System.out.println("inside:"+e); } } catch(Exception e) { System.out.println(e); } } } Runtime Exception: -------------------- java.lang.ClassNotFoundException:sun.jdbc.odbc.JDbcOdbcDriver
|
 |
trinadh reddy
Ranch Hand
Joined: Sep 22, 2005
Posts: 58
|
|
give the classname as sun.jdbc.odbc.JdbcOdbcDriver
|
 |
sailesh sirari
Greenhorn
Joined: Aug 16, 2005
Posts: 9
|
|
hi Class.forName("sun.jdbc.odbc.JDbcOdbcDriver"); this line should be Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); be careful for typos as it will not give error Cheers! Sailesh
|
 |
 |
|
|
subject: classnotfoundexception
|
|
|