public static Connection getConnection() {
ResourceBundle rb = ResourceBundle.getBundle("db");
try {
String driverName = rb.getString("db.driver");
Driver dirver = (Driver)Class.forName(driverName).newInstance();
String url = rb.getString("db.url");
Connection con = DriverManager.getConnection(url);
return con;
} catch(ClassNotFoundException cnfExc) {
System.out.println(cnfExc.getMessage());
cnfExc.printStackTrace();
} catch(SQLException sqlExc) {
System.out.println(sqlExc.getMessage());
sqlExc.printStackTrace();
} catch(IllegalAccessException e) {
System.out.println(e.getMessage());
e.printStackTrace();
} catch(Exception e) {
System.out.println(e.getMessage());
e.printStackTrace();
}
return null;
}
最后怎么返回null