Advertisement
Guest User

Untitled

a guest
Apr 10th, 2016
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.70 KB | None | 0 0
  1.     private Connection getConnection()
  2.     {
  3.         Connection connection = null;
  4.         String DBURL = "jdbc:derby:database/DealershipDB;";
  5.         try
  6.         {
  7.             //Set the directory
  8.             //String dbDirectory = "db";
  9.             //System.setProperty("derby.system.home", dbDirectory);
  10.  
  11.             //Set the db url, username, and password
  12.             //String url = "jdbc:derby:database/DealershipDB;";
  13.             //String username = "";
  14.             //String password = "";
  15.  
  16.             connection = DriverManager.getConnection(DBURL);
  17.             return connection;
  18.         }
  19.         catch(SQLException e)
  20.         {
  21.             System.err.println(e);
  22.             return null;
  23.         }
  24.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement