jdbc连接mysql
1 private String name="com.mysql.jdbc.Driver"; 2 private String url="jdbc:mysql://127.0.0.1/user"; 3 private String user="root"; 4 private String password="root"; 5 private Connection conn=null; 6 7 Class.forName(name); 8 conn=DriverManager.getConnection(url,user,password);