public static Connection getConnection() {
try {
Class.forName("org.gjt.mm.mysql.Driver"); // Class.forName("myDriver.ClassName");
// ?
} catch (java.lang.ClassNotFoundException e) {
System.err.print("ClassNotFoundException: ");
System.err.println(e.getMessage());
}
try {
con = DriverManager.getConnection(url, userid, password);
} catch (SQLException ex) {
System.err.println("SQLException: " + ex.getMessage());
}
return con;
}
댓글 없음:
댓글 쓰기