Skip to content

Instantly share code, notes, and snippets.

@rajacsp
Forked from rajasgs/Oracle12CEETest
Created April 18, 2019 22:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rajacsp/153e467c764655cf615262d0c3c0e4c7 to your computer and use it in GitHub Desktop.
Save rajacsp/153e467c764655cf615262d0c3c0e4c7 to your computer and use it in GitHub Desktop.
package org.rj;
import java.sql.*;
public class Oracle12CEETest {
private final static String DB_URL = "jdbc:oracle:thin:@//127.0.0.1:1521/orcl";
private final static String USER = "system";
private final static String PASS = "oracle";
public static void main(String[] args) {
Connection conn = null;
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
System.out.println("Connecting to database...");
conn = DriverManager.getConnection(DB_URL, USER, PASS);
System.out.println("Connected");
} catch (Exception e) {
e.printStackTrace();
} finally {
if (conn != null) {
try {
conn.close();
} catch (SQLException e) {
// ignore
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment