Advertisement
strikero

edejer

Feb 27th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. private static final String URL = "jdbc:oracle:thin:@localhost:1521:orcl";
  2. private static final String Username = "DBProject";
  3. private static final String Password = "database";
  4. Connection con;
  5.  
  6.  
  7. public void connect(){
  8. try {
  9. con = DriverManager.getConnection(URL, Username, Password);
  10. } catch (SQLException ex) {
  11. ex.printStackTrace();
  12. }
  13. }
  14.  
  15. public void disconnect(){
  16. try {
  17. con.close();
  18. } catch (SQLException ex) {
  19. ex.printStackTrace();
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement