Here you can find the source of getConnection()
public static Connection getConnection() throws Exception
//package com.java2s; //License from project: Apache License import java.sql.Connection; import java.sql.DriverManager; public class Main { private static Connection connection = null; public static Connection getConnection() throws Exception { if (connection != null) { return connection; } else {/*from w ww .j a v a 2 s. co m*/ String serverName = "IBCDS408"; String portNumber = "1521"; String sid = "DEV.BCDSS"; String dbUrl = "jdbc:oracle:thin:@" + serverName + ":" + portNumber + ":" + sid; try { Class.forName("oracle.jdbc.driver.OracleDriver"); connection = DriverManager.getConnection(dbUrl, "BCDSS_DEV", "developmentonly"); } catch (Exception e) { e.printStackTrace(); } return connection; } } }