1 String driverName="com.mysql.jdbc.Driver"; 2 String userName="root"; 3 String userPwd="123456"; 4 String dbName="students"; 5 String url1="jdbc:mysql://localhost:3306/"+dbName; 6 String url2="?user="+userName+"&password="+userPwd; 7 String url3="&useUnicode=true&characterEncoding=UTF-8"; 8 String url=url1+url2+url3; 9 Class.forName(driverName); 10 Connection conn=DriverManager.getConnection(url);