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; public class Main { public static Connection getConnection() { try {// w ww.ja va 2 s.co m Class.forName("oracle.jdbc.driver.OracleDriver"); String url = "jdbc:oracle:thin:@bej301056.cn.oracle.com:1521:house02"; String username = "transrepo"; String password = "welcome1"; Connection conn = DriverManager.getConnection(url, username, password); //System.out.println("Create Connection"); return conn; } catch (Exception e) { System.out.println(e.getMessage()); return null; } } }