This is a basic java program to perform the following operations
- Create a table
- Insert Records into the table.
- Retrieve data from the database
- Download JDBC Driver for MySQL using the link given below
https://dev.mysql.com/downloads/connector/j/
select platform independent from the dropdown menu and download the tar file. - Open XAMPP Control Panel and Turn on Apache and MySQL modules.
- Create a database in phpmyadmin.
- Create a new project in netbeans.
- Expand the projects folder and right click on libraries and select add JAR/Folder
- Select mysql-connector-java-8.0.12.jar and click open.
- Now, Open Windows > services.
- On the left window. Right click on databases and click on new connection.
- When the dialog box opens Click Add and select the mysql-connector-java-8.0.25.jar file . and select MySQL (Connector/J driver) from Driver drop-down and Click Next.
- In the Customize Connection window, replace the Database name with the name we want to give to the db.
- Click Test Connection.
- Store the Photos in a folder in your system. Change the location in the code as required. and create an empty folder to retrieve the student photo from database and change the location in the code as required.
- Replace the user, password and database name in the code according to phpMyadmin credentials. The default user -'root' and password - '' is used in this java code.
- Now, you may build and run the program.