Java JDBC Oracle Connection createDataBaseConnection(String hostName, String portNumber, String userName, String password)

Here you can find the source of createDataBaseConnection(String hostName, String portNumber, String userName, String password)

Description

create Data Base Connection

License

Open Source License

Declaration

public static Connection createDataBaseConnection(String hostName, String portNumber, String userName,
            String password) throws SQLException, ClassNotFoundException 

Method Source Code

//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*/
    }
}

Related

  1. createConnection()
  2. CreateTableScript(String dbSourceName, String db2SchemaName, String schemaList, String server, int port, String dbName, String userid, String pwd)
  3. getConnection()
  4. getConnection()
  5. getConnection()