The code is huge atm, there's much going on in this class. I'll post the constructor and everything in main as it must be down to that:
Code:
public DBConn(String remoteLocation, String database, String userName, String password) {
this.remoteLocation = remoteLocation;
this.database = database;
this.userName = userName;
this.password = password;
try {
stmt = con.createStatement();
}
catch (SQLException ex) {
System.out.println("You ****");
}
}
and the instance variables
Code:
private String remoteLocation;
private String database;
private String userName;
private String password;
private Connection con;
private Statement stmt;
and main
Code:
public class Test {
public static void main(String[] args) {
String db = "****";
String dbname = "****";
String username = "****";
String pwd = "****";
DBConn connection = new DBConn(db, dbname, username, pwd);
connection.loadDriver();
connection.initialise();
connection.createDB();
System.out.print("Table created!");
connection.shutdown();
System.out.print("Connection shutdown");
}
}