Created
March 26, 2019 20:06
-
-
Save rajasgs/bc318465d4d10ab352108ca874f79049 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Oracle11GDebianTest { | |
private final static String DB_URL = "jdbc:oracle:thin:@//127.0.0.1:1522/XE"; | |
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