private DataBaseManager() {
try {
String url = "jdbc:odbc:Flight";
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection(url);
stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_UPDATABLE);
}
catch (SQLException sqle) {
System.out.println(sqle.toString());
}
catch (ClassNotFoundException cnfex) {
cnfex.printStackTrace();
}
}
这是我连接数据库的代码 请帮我看下 谢谢啦!!!!:) |