Here you can find the source of getDatabaseConnection()
public static Connection getDatabaseConnection()
//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 final String DB_URL = "jdbc:oracle:thin:@localhost:1521:xe"; private static final String USER = "system"; private static final String PASS = "system"; public static Connection getDatabaseConnection() { Connection conn = null;//from ww w . j av a 2 s.c o m try { conn = DriverManager.getConnection(getDbUrl(), getUser(), getPass()); } catch (SQLException e) { System.out.println("DBHelper failed to create database connection"); e.printStackTrace(); } return conn; } public static String getDbUrl() { return DB_URL; } public static String getUser() { return USER; } public static String getPass() { return PASS; } }