Advertisement
Guest User

Untitled

a guest
Jan 31st, 2017
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. public static Connection getConnection(){
  2. Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
  3. String url = "jdbc:derby:<slave db location>;startSlave=true";
  4. System.out.println("about to fetch connection");
  5. Connection con= null;
  6. try{
  7. con=DriverManager.getConnection(url, "root", "root");
  8. }catch(Exception e){
  9. e.printStackTrace();
  10. }
  11. System.out.println("return con -"+con);
  12. return con;
  13. }
  14.  
  15. public static Connection getConnection(){
  16. Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
  17. String url = "jdbc:derby:<slave db location>;";
  18. System.out.println("about to fetch connection");
  19. Connection con= null;
  20. try{
  21. con=DriverManager.getConnection(url, "root", "root");
  22. }catch(Exception e){
  23. e.printStackTrace();
  24. }
  25. System.out.println("return con -"+con);
  26. return con;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement