日期:2014-05-20 浏览次数:20963 次
public static Connection getConnection() throws ClassNotFoundException { Connection conn=null; try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); String url="";//这里怎么写啊 conn = DriverManager.getConnection(url , "admin" , "cmsyu"); }catch (ClassNotFoundException e) { e.printStackTrace(); logger.log(Level.INFO, "----找不到数据库驱动.../n" + e.getMessage()); } catch (SQLException e) { e.printStackTrace(); logger.log(Level.INFO, "----连接Access数据库错误.../n" + e.getMessage()); } return conn; }