Connection c=DriverManager.getConnection("jdbc:odbc:shop");
不知道你的这里的设置是怎样处理的,但是一般的access数据库是访问一个*.mdb文件的这是一个访问本地的access的情况:
String url="jdbc:odbc:driver={Microsoft Access Driver (*.mdb)};DBQ=C:\\Tomcat\\webapps\\ROOT\\myApp\\msgcenter.mdb";Connection conn=DriverManager.getConnection(url);
 不知道你的是否这样处理了?

解决方案 »

  1.   

    String str1="jdbc:odbc:driver={Microsoft Access Driver (*.mdb)};DBQ=你的数据库"
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection conn=DriverManager.getConnection(url);
    Statement stmt=conn.createStatement();
    ResultSet rs=stmt.executeQuery("select * from produce");
      

  2.   

    楼上的方法就是最好的
    只要在driver后面加上odbc驱动即可不用设置数据源
    推荐你使用
      

  3.   

    可是我的为什么java.sql.SQLException: [Microsoft][ODBC 驱动程序管理器] 未发现数据源名称并且未指定默认驱动程序