Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.62 KB | None | 0 0
  1. package common;
  2.  
  3. import java.sql.Connection;
  4. import java.sql.DriverManager;
  5. import java.sql.SQLException;
  6.  
  7. public class GmsisDatabase {
  8.  
  9.     private GmsisDatabase(){
  10.  
  11.     }
  12.  
  13.     public Connection getConnection()
  14.     {
  15.         String host = "jdbc:derby://localhost:1527/sample";
  16.         String username = "Asehailia";
  17.         String password = "Tg@123";
  18.         Connection con = null;
  19.         try{
  20.           con = DriverManager.getConnection( host, username, password );  
  21.         }
  22.         catch (SQLException e) {
  23.             System.out.println(e.getMessage());
  24.         }
  25.         return con;    
  26.     }
  27.    
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement