Here you can find the source of getOracleDBConnection(String server, String database, String username, String password)
private static Connection getOracleDBConnection(String server, String database, String username, String password) throws SQLException
//package com.java2s; //License from project: Apache License import java.sql.*; public class Main { private static Connection getOracleDBConnection(String server, String database, String username, String password) throws SQLException { Connection conn = null;/*ww w. jav a 2s. c o m*/ try { Class.forName("oracle.jdbc.driver.OracleDriver"); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } try { conn = DriverManager.getConnection("jdbc:oracle:thin:@" + server + ":1521:" + database, username, password); } catch (SQLException e) { e.printStackTrace(); } return conn; } }