Commit 788da211 authored by RAYMOND XIA's avatar RAYMOND XIA
Browse files

added commented code for parameterized sql server

parent 2b391d9e
......@@ -501,7 +501,10 @@ public class ClientApplication {
}
public static boolean authDatabase() {
String pwd, db;
String server, pwd, db;
// System.out.print("Enter the SQL server to connect to: ");
// server = input.nextLine();
server = "marmoset03.shoshin.uwaterloo.ca";
System.out.print("Enter username for the SQL server: ");
User = input.nextLine();
pwd = new String(System.console().readPassword("Enter password for the SQL server: "));
......@@ -513,7 +516,7 @@ public class ClientApplication {
}
db = input.nextLine();
try {
c = DriverManager.getConnection(Constants.db_url, User, pwd);
c = DriverManager.getConnection("jdbc:mysql://" + server, User, pwd);
if (c.isClosed()) System.out.print("yoooo im closed");
Statement st = c.createStatement();
String query = "use " + db;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment