Skip to content

Commit

Permalink
patch again
Browse files Browse the repository at this point in the history
  • Loading branch information
gokris165 committed Jun 13, 2024
1 parent 2a7a53d commit 08a6803
Showing 1 changed file with 2 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,36 +37,6 @@ public class ServerWindow {
@Autowired
private Environment env;

// @Autowired
// public ServerWindow(ServerSecurity serverSecurity) throws SQLException
// {
// this.serverSecurity = serverSecurity;
// clientWindowMap = new HashMap<>();

// // TODO: Change to config
// String url = "jdbc:mysql://localhost:3306";
// String uname = "root";
// String password = "mchougule478";
// String dbName = "DTN_SERVER_DB";

// database = new SNRDatabases(url, uname, password, dbName);

// try {
// initializeWindow();
// } catch (SQLException | BufferOverflow | InvalidLength e) {
// System.out.println(e + "\n[WIN] INFO: Failed to initialize window from database");

// String dbTableCreateQuery = "CREATE TABLE " + dbTableName + " " +
// "(clientID VARCHAR(256) not NULL," +
// STARTCOUNTER + " VARCHAR(256)," +
// ENDCOUNTER + " VARCHAR(256)," +
// WINDOW_LENGTH + " INTEGER," +
// "PRIMARY KEY (clientID))";

// database.createTable(dbTableCreateQuery);
// }
// }

@PostConstruct
public void init() throws SQLException {
// TODO: Change to config
Expand All @@ -83,8 +53,8 @@ public void init() throws SQLException {
System.out.println(e + "\n[WIN] INFO: Failed to initialize window from database");

String dbTableCreateQuery =
"CREATE TABLE " + dbTableName + " " + "(clientID VARCHAR(256) not NULL," + STARTCOUNTER +
" VARCHAR(256)," + ENDCOUNTER + " VARCHAR(256)," + WINDOW_LENGTH + " INTEGER," +
"CREATE TABLE " + dbTableName + " " + "(clientID VARCHAR(256) not NULL," + STARTCOUNTER +
" VARCHAR(256)," + ENDCOUNTER + " VARCHAR(256)," + WINDOW_LENGTH + " INTEGER," +
"PRIMARY KEY (clientID))";

database.createTable(dbTableCreateQuery);
Expand Down

0 comments on commit 08a6803

Please sign in to comment.