代码是网上找的没怎么看懂,请大神指点
public class TestJDBC {
public static Connection getSQLConnection() throws SQLException,java.lang.ClassNotFoundException{
Class.forName("com.mysql.jdbc.Driver");
String url = "jdbc:mysql://localhost:3306/learn";
String userName = "root";
String password = "123456";
Connection con = DriverManager.getConnection(url,userName,password);
return con;
}
public static void main(String[] args) {
try{
Connection con = getSQLConnection();
Statement sql = con.createStatement();