JAVA JDBC 连接数据库

方式一

Driver driver = new com.mysql.jdbc.Driver();
String url = "jdbc:mysql://localhost:3306/test";
Properties info = new Properties();
info.setProperty("user","root");
info.setProperty("password","1234");
Connection connection = driver.connect(url,info);
System.out.println(connection);

猜你喜欢

转载自www.cnblogs.com/superxuezhazha/p/12372837.html