SQLException:No suitable driver found for jdbc:odbc:TestDB
package jdbc;
import java.sql.*;
public class Example10_1 {
public static void main(String[] args) {
// TODO Auto-generated method stub
String JDriver="sun.jdbc.odbc.JdbcOdbcDriver";
String conURL="jdbc:odbc:TestDB";
try{
Class.forName(JDriver);
}
catch(java.lang.ClassNotFoundException e)
{
System.out.println("ForName:"+e.getMessage());
}
try{
Connection con=DriverManager.getConnection(conURL);
Statement s=con.createStatement();
String query="create table student("+"id char(10),"+"name char(15),"+"score integer"+")";
s.executeUpdate(query);
s.close();
con.close();
}
catch(SQLException e){
System.out.println("SQLException:"+e.getMessage());
}
}
}