Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package bettingwise;
- import java.sql.Connection;
- import java.sql.DriverManager;
- import java.sql.ResultSet;
- import java.sql.SQLException;
- import java.sql.Statement;
- public class DBConnect {
- private final String
- HOST = "jdbc:mysql://bettingwise.cwhagl14f78g.eu-west-2.rds.amazonaws.com:3306/bettingwise_db",
- USERNAME = "Masteradmin",
- PASSWORD = "A9s1QKQv7Twtmhtu";
- private Connection Connection;
- private Statement Statement;
- private ResultSet ResultSet;
- /**
- * Establishes connection to database.
- * @throws SQLException When a safe connection cannot be established.
- */
- public DBConnect() throws SQLException {
- Connection = DriverManager.getConnection(HOST, USERNAME, PASSWORD);
- Statement = Connection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
- }
- public Statement getStatement() {
- return this.Statement;
- }
- public void setResultSet(ResultSet resultSet) {
- this.ResultSet = resultSet;
- }
- public ResultSet getResultSet() {
- return this.ResultSet;
- }
- public Connection getConnection() {
- return this.Connection;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement