In this video we will write Java program to retrieve data from Customer table. To keep the example simple we will use the following SQL query SELECT * FROM CUSTOMER;
In this video we will be creating SelectRow.java class in which we will define all() method. This method when called from other class will return all the rows that are present in Customer table.
0:12 So far in this MySQL tutorial using JCreator
0:36 Open MySQLProject in JCreator
0:44 Create SelectRow class inside src folder
1:20 import packages
1:47 Define all() method inside SelectRow class
2:06 Connection Statement ResultSet variables
2:25 jdbc driver
2:37 DriverManager.getConnection()
2:59 Create and execute sql select query
3:19 con.createStatement()
3:28 stmt.executeQuery()
3:41 Display result
5:26 Close resources
6:40 Open MySQLProject.java file and call SelectRow.all()
7:03 Build and Run project
If you have not yet installed MySQL and need some help in the installation process then kindly watch this video
• MySQL | How to install MySQL on Windows
To create mydb database in MySQL kindly watch this video
• MySQL | Getting Started with MySQL
To connect MySQL and JCreator kindly watch this video
• MySQL | How to connect MySQL and JCreator
To create MySQL database connection in JCreator watch this video
• MySQL | How to create MySQL database conne...
You can download the project code from my GitHub repository
https://github.com/yusufshakeel/SQL-P...