Here you can find the source of getConnection()
public static Connection getConnection()
//package com.java2s; //License from project: Apache License import java.sql.Connection; import java.sql.DriverManager; public class Main { private static final String URL = "jdbc:mysql://127.0.0.1:3306/hanzi"; private static final String USER = "root", PASSWORD = "root"; public static Connection getConnection() { try {// www . java2 s . c o m Connection connection = DriverManager.getConnection(URL, USER, PASSWORD); return connection; } catch (Exception e) { throw new RuntimeException(e); } } }