Core java tutorial for beginners
A tutorial blog which explains different core concepts related to Java along with programming examples
Subscribe to Startertutorials.com's YouTube channel for different tutorial and lecture videos.

Delete data in a table using JDBC and MYSQL

Categories: JDBC. No Comments on Delete data in a table using JDBC and MYSQL

In this example, we will try to delete the record of student with id 5. The Java code for deleting a record in a MYSQL table using JDBC is given below: import java.sql.*; public class DeleteData { static final String DB_URL = "jdbc:mysql://localhost/sampledb"; static final String USER = "root"; static final String PASS = "123456"; […]

Read the rest of this entry »

Update data in a table using JDBC and MYSQL

Categories: JDBC. No Comments on Update data in a table using JDBC and MYSQL

The Java code for updating a record in a MYSQL table using JDBC is given below: import java.sql.*; public class UpdateData { static final String DB_URL = "jdbc:mysql://localhost/sampledb"; static final String USER = "root"; static final String PASS = "123456"; static final String QUERY = "UPDATE students SET mobile=7788665544 where id=5"; public static void main(String[] […]

Read the rest of this entry »

Display data from table using JDBC and MYSQL

Categories: JDBC. No Comments on Display data from table using JDBC and MYSQL

In this example, we will use MYSQL DBMS which contains a database named sampledb and a table named students. The credentials for connecting to the database requires username and password as root and 123456 respectively. The data in the students table is given below:   For working with MYSQL DBMS and the databases in it, […]

Read the rest of this entry »

JDBC implementation steps

Categories: JDBC. No Comments on JDBC implementation steps

The basic implementation steps involved in developing a JDBC application are: Load and register the driver Establish a Connection between Java application and database Create a Statement object Execute the query on the database Process the result using ResultSet Close the connection   Before loading and registering the driver you need to import java.sql package […]

Read the rest of this entry »