我连接Java来Microsoft Access数据库,但我有以下异常Java数据库连接异常
值java.sql.SQLException:[微软] [ODBC驱动程序管理器]数据源名称找不到和未指定默认驱动程序
try{
String ProjectPath= System.getProperties().getProperty("user.dir");
System.out.println(ProjectPath);
String path,fullstring;
path=ProjectPath+"\\data.mdb";
fullstring="jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=" +path;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection(fullstring);
System.out.println("Connected");
}catch(Exception e){
System.out.println("Connected Error: "+ e);
}
我该如何解决我的问题?
题外话,但你有没有使用JPA?它比JDBC更舒适。看一看,你会喜欢它;) – NiziL
可能的重复[如何使用Java程序连接MS Access数据库?](http://stackoverflow.com/questions/6880879/how-to-connect-ms- access-database-using-java-program) – SpringLearner
您是否尝试过通过IDE进行连接?什么是网址? –