这是本人的代码
jdbcDB.java
private static String drivername = “com.mysql.jdbc.Driver”;
private static String url = “jdbc:mysql://localhost:3306/hotel”;
private static String user = “root”;
private static String password = “123456”;
static{
try {
Class.forName(drivername);
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public static Connection getConnection(){
Connection conn=null;
try {
conn = DriverManager.getConnection(url,user,password);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return conn;
}
public static void closeConnection(Connection conn){
try {