Advertisement
Guest User

Untitled

a guest
May 5th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. String jdbcURL = "jdbc:derby:test;create=true";
  2. String user = "app";
  3. String password = "app";
  4. Connection connection = null;
  5.  
  6. public static Connection getConnection() {
  7. try {
  8. Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
  9. connection = DriverManager.getConnection(jdbcURL, user, password);
  10. System.out.println("Connected");
  11. return connection;
  12. } catch (Exception ex) {
  13. System.out.println("message: " + ex.getMessage() + "nNot connected");
  14. return null;
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement