This is an online examination system built using JAVA and MySQL. Follow these steps to implement it.
- Download the latest version of the Java Development Kit from the website according to your OS. You can refer to this website for JDK 9.
- Download the latest version of MySQL from this website according to your OS. You can refer to the installation steps accordingly.
- Do not forget to change the default password of MySQL.
- Check if you have installed MySQL successfully by running the following command on your terminal :
After this, enter the new password you have created. This also verifies whether your new password has been successfully created or not.
usr/local/mysql/bin/mysql -uroot -p
- Once you are done setting up Java and MySQL on your machine, download any of the MySQL connectors compatible with Java. You can either download the ODBC or the JDBC connector. I have downloaded JDBC from this website.
- Now that the interface is set up, create the database and the tables required for the working of our code.
- Start MySQL server.
- Log in to MySQL using the previously mentioned command and your password.
- Create the database.
- Switch to the database and create the required tables according to the schema.
- Check values in all tables. All of them should be empty now.
- Change the login credentials in the code, i.e., password and database, table names.
- Copy the jar file from the JDBC you have downloaded in the local repository if you don't have it already.
- Switch to the repository on your terminal and export the classpath using the following command :
export CLASSPATH=mysql-connector-java-5.1.45-bin.jar:.
- Compile the java program using the following command :
javac OnlineTest.java
- Run the program using the following command :
java OnlineTest