Create a new java project inside your IDE, IntelliJ. Add a new java class to the src-folder of your project and call it DatabaseConnection.
Connect your program to the classicmodels database. (Make sure that you have added classicmodels to your MYSQL-server).
Write two different methods in DatabaseConnection class. One for retrieving data from database and the other for updating (or deleting) data in the database (you can decide about what the methods shall do). resultset, executeQuery and executeUpdate shall be used in this task and you need to make sure that you understand thedifference between executeQuery and executeUpdateand when you shall use each of them.
Connecting Java to database Jdbc.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here