Java JDBC Oracle Connection getOracleConnection()

Here you can find the source of getOracleConnection()

Description

get Oracle Connection

License

Open Source License

Declaration

public static Connection getOracleConnection() throws Exception 

Method Source Code

//package com.java2s;

import java.sql.Connection;

import java.sql.DriverManager;

public class Main {
    public static Connection getOracleConnection() throws Exception {
        String driver = "oracle.jdbc.driver.OracleDriver";
        String url = "jdbc:oracle:thin:@localhost:1521:caspian";
        String username = "mp";
        String password = "mp2";

        Class.forName(driver); // load Oracle driver
        Connection conn = DriverManager.getConnection(url, username, password);
        return conn;
    }//from   www.ja  v  a2 s .  c o  m
}

Related

  1. getDBVersion(String dbSourceName, String server, int port, String dbName, String userid, String pwd)
  2. getJDBCConn(String hostname, String port, String sid, String username, String pwd)
  3. getJDBCConnection()
  4. getOracle10GConnection(String connIP, String port, String dbName, String username, String password)
  5. getOracleConn()
  6. getOracleDBConnection(String server, String database, String username, String password)
  7. GetSchemaList(String dbSourceName, String server, int port, String dbName, String userid, String pwd)
  8. OpenConnection(String dbSourceName, String server, int port, String dbName, String userid, String pwd)