JDBC连接数据库的方式

 
n加载驱动:
Class.forName("com.mysql.jdbc.Driver");
n与数据库进行连接:
conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/数据库名?user=用户名&password=数据库密码&useUnicode=true&characterEncoding=GBK");
原文地址:https://www.cnblogs.com/shangwne/p/3617563.html