public class baseDao {
public static Connection getConnections(){
Connection con=null;
try {
Class.forName("com.mysql.jdbc.Driver");
// jdbc:mysql://localhost:3306/servletcrud
con = DriverManager.getConnection("jdbc:mysql://localhost:3306/servletcrud", "root", "root");
System.out.println("获取到连接啦~");
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (SQLException throwables) {
throwables.printStackTrace();
}
return con;
}
}
//笔记
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)