JDBC 连接Mysql
方法一
@Test
public void testConnection1() throws Exception{
//创建驱动
Driver driver = new com.mysqk.jdbc.Driver();
//jdbc:mysql:协议
//localhost:ip地址
//3306:默认mysql的端口号
//test:test数据库
String url ="jdbc:mysql://localhost:3306/test";
//将用户名和密码封装在Properties中
Properties info = new Properties();
info.setProperty("user","root");
info.setProperty("password","1234"