Here you can find the source of getConnection()
public static Connection getConnection()
//package com.java2s; //License from project: Open Source License import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class Main { private static Connection connection = null; public static Connection getConnection() { if (connection != null) { return connection; } else {//from w w w .j av a 2 s.c o m try { String host = "jdbc:derby://localhost:1527/RosterDB"; String uName = "app"; String uPass = "app"; connection = DriverManager.getConnection(host, uName, uPass); } catch (SQLException err) { System.out.println(err.getMessage()); } return connection; } } }