Here you can find the source of getConnection()
public static Connection getConnection() throws ClassNotFoundException, SQLException
//package com.java2s; //License from project: Open Source License import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.util.ResourceBundle; public class Main { public static Connection getConnection() throws ClassNotFoundException, SQLException { ResourceBundle rb = ResourceBundle.getBundle("db"); Class.forName(rb.getString("drivername")); Connection con = DriverManager.getConnection(rb.getString("dburl"), rb.getString("userid"), rb.getString("password")); return con; }/*from w w w . j a v a 2s . c o m*/ }