get oracle Connection on Amazon Web Service - Java JDBC

Java examples for JDBC:Oracle

Description

get oracle Connection on Amazon Web Service

Demo Code


//package com.java2s;
import java.sql.Connection;
import java.sql.DriverManager;

public class Main {
    public static Connection getConnection() {
        try {/*from w w  w  .j  ava2 s. co  m*/
            Class.forName("oracle.jdbc.driver.OracleDriver");
            return DriverManager
                    .getConnection(
                            "jdbc:oracle:thin:@oracleee.yourid.ap-northeast-1.rds.amazonaws.com:1521:ORCL",
                            "admin", "aaa");
        } catch (Exception e) {
            e.printStackTrace();
        }

        return null;
    }
}

Related Tutorials