- Compile client and servers with 'javac -cp mysql-connector-java-8.0.22/mysql-connector-java-8.0.22.jar: Server_A.java Server_B.java Client.java'
- Run Server_A with 'java -cp mysql-connector-java-8.0.22/mysql-connector-java-8.0.22.jar: Server_A' in one terminal (Same process but for Server_B)
- Run Client with 'java Client' in another terminal
- Send message type 'REGISTER', 'UPDATE', etc. by typing it in the Client's terminal
- Exit server and client by using ctrl-c in their according terminal window
- From SQLWorkbench, press + symbol to add a server for "MySQL Connections"
- Under host, add database-1.cgsj5cw6pwbs.ca-central-1.rds.amazonaws.com
- Under username, add admin
- Under password "store in vault/keychain", add COEN4452020
- Change connection name to your liking
- Expand COEN445 to display the tables
- Before issueing a query from SQL, make sure to write and run (electricity symbol): USE COEN445
- After running this SQL query, remove USE COEN445, and perform any other query (SELECT, INSERT, DROP, etc.)
- To run in program, add .jar to program classpath
- Connect to the DB from the program
- Use methods from DB_interface.java
Before being able to run any Database operations you must include the JDBC client jar (system independent) in your build/project path.
All database operations are configured as atomic transactions in the DB_interface.class, which provides a simple interface that the servers need to call. The a brief test of how it works is configured in DB_driver.class
It is highly advised to not play with it blindly but to install a MySQL workbench available here: https://dev.mysql.com/downloads/workbench/ It will allow you to perform any operations on the database and will help debugging.
Currently implemented actions: - Get all users - Register new user - Get user info