Java JDBC Oracle Connection getJDBCConnection()

Here you can find the source of getJDBCConnection()

Description

get JDBC Connection

License

Open Source License

Declaration

public static Connection getJDBCConnection() 

Method Source Code


//package com.java2s;

import java.sql.Connection;
import java.sql.DriverManager;

public class Main {
    public static Connection getJDBCConnection() {
        try {/*  w ww . java2  s  .c om*/
            Connection conn = null;
            Class.forName("oracle.jdbc.driver.OracleDriver");
            conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE", "dms", "dms");
            return conn;
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }
}

Related

  1. getConnection(String dbType, String dbIp, String dbPort, String dbName, String userName, String password)
  2. getConnection(String ip, String serviceName, String uid, String pwd)
  3. getDatabaseConnection()
  4. getDBVersion(String dbSourceName, String server, int port, String dbName, String userid, String pwd)
  5. getJDBCConn(String hostname, String port, String sid, String username, String pwd)
  6. getOracle10GConnection(String connIP, String port, String dbName, String username, String password)
  7. getOracleConn()
  8. getOracleConnection()
  9. getOracleDBConnection(String server, String database, String username, String password)