PreparedStatement is an interface and has pre-compiled SQL statements. PreparedStatements are used to efficiently execute the same SQL statement multiple times. They are also used to set the parame
Insert record using Prepared Statement in Java
PreparedStatement is an interface and has pre-compiled SQL statements. PreparedStatements are used to efficiently execute the same SQL statement multiple times. They are also used to set the parame
Select records using Prepared Statement
To select records using Prepared Statement in java we use
1 |
ResultSet executeQuery(String sql) throws SQLException |
Batch Processing using Statement in Java
Batch processing is a feature in JDBC used to club multiple SQLs and send it to database in one call. Imagine you have 100’s of inserts to be fired using JDBC, this will take 100’s of c
Select records using Statement in Java
To select records using Statement in java we use
1 |
ResultSet executeQuery(String sql) throws SQLException |
Delete record using Statement in Java
We saw how to Create a table and Insert Data using Statement in Java. Now lets delete some of the data from the table using Statement. Delete record SQL Below is the query that can be fired directl
Update record using Statement in Java
We saw how to Create a table and Insert Data using Statement in Java. Now lets update the data into that is already present in the table using Statement. Update record SQL Below is the query that c
Insert record using Statement in Java
We saw how to Create Table using Statement in Java. Now lets insert data into this table using Statement. Insert record SQL Below is the query that can be fired directly on database to insert recor
Create Table using Statement in Java
Statements in JDBC are used to execute SQL statements that do not require dynamic parameters passed to the query. Lets see how to create create table using statement in java. Please note : We will
Connect to MySQL using JDBC
In this post we will see the sample code to connect to MySQL using JDBC drivers in java. For connecting to MySQL database we will need the following 1. Connection URL The format is [crayon-6483348a