Advertisement
Guest User

Untitled

a guest
Nov 21st, 2018
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1.  
  2. package bettingwise;
  3.  
  4. import java.sql.Connection;
  5. import java.sql.DriverManager;
  6. import java.sql.ResultSet;
  7. import java.sql.SQLException;
  8. import java.sql.Statement;
  9.  
  10. public class DBConnect {
  11.  
  12. private final String
  13. HOST = "jdbc:mysql://bettingwise.cwhagl14f78g.eu-west-2.rds.amazonaws.com:3306/bettingwise_db",
  14. USERNAME = "Masteradmin",
  15. PASSWORD = "A9s1QKQv7Twtmhtu";
  16.  
  17. private Connection Connection;
  18. private Statement Statement;
  19. private ResultSet ResultSet;
  20.  
  21. /**
  22. * Establishes connection to database.
  23. * @throws SQLException When a safe connection cannot be established.
  24. */
  25. public DBConnect() throws SQLException {
  26. Connection = DriverManager.getConnection(HOST, USERNAME, PASSWORD);
  27. Statement = Connection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
  28. }
  29.  
  30. public Statement getStatement() {
  31. return this.Statement;
  32. }
  33.  
  34. public void setResultSet(ResultSet resultSet) {
  35. this.ResultSet = resultSet;
  36. }
  37.  
  38. public ResultSet getResultSet() {
  39. return this.ResultSet;
  40. }
  41.  
  42. public Connection getConnection() {
  43.  
  44. return this.Connection;
  45. }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement