Here you can find the source of createDataBaseConnection(String hostName, String portNumber, String userName, String password)
public static Connection createDataBaseConnection(String hostName, String portNumber, String userName, String password) throws SQLException, ClassNotFoundException
//package com.java2s; //License from project: Open Source License import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class Main { public static Connection createDataBaseConnection(String hostName, String portNumber, String userName, String password) throws SQLException, ClassNotFoundException { Class.forName("oracle.jdbc.OracleDriver"); return DriverManager.getConnection("jdbc:oracle:thin:@" + hostName + ":" + portNumber + ":" + hostName, userName, password);/*from w ww .j a v a2 s . com*/ } }