SQLException:No suitable driver found for jdbc:odbc:TestDB

uniquewdl 2016-01-27 07:25:52
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());

}
}

}
...全文
672 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

7,713

社区成员

发帖
与我相关
我的任务
社区描述
Microsoft Office Access是由微软发布的关系数据库管理系统。它结合了 MicrosoftJet Database Engine 和 图形用户界面两项特点。
社区管理员
  • Access
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧