Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class DBConnect {
- public static void main(String args[]) {
- Connection connection = null;
- Statement stmt = null;
- try {
- //load database driver
- Class.forName("oracle.jdbc.driver.OracleDriver");
- } catch (ClassNotFoundException ex) {
- Logger.getLogger("Driver not found");
- }
- try {
- connection = DriverManager.getConnection(
- "jdbc:oracle:thin:@oracle12c.hua.gr:1521:orcl", "IT21609",
- "IT21609");
- } catch (SQLException ex) {
- Logger.getLogger("Server not found");
- }
- System.out.println("ok");
- assert connection != null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement