ResultSet in JDBC- Types and Use

[crayon-5905c0ca133a4252969109-i/] is an interface that can hold the records from the database. Types of ResultSet in JDBC ResultSet in JDBC can be of 3 types and can be defined while creation of the Statement 1. TYPE_FORWARD_ONLY – Default 2. TYPE_SCROLL_SENSITIVE – Created

Read More

Scrollable ResultSet in JDBC example

A normal ResultSet object can only move in forward direction. But using the ResultSet.TYPE_SCROLL_SENSITIVE we can create Scrollable Resultset in JDBC. What is Scrollable Resultset in JDBC Scrollable Resultset is the resultset which can move forward or backward or move to any

Read More

Update Record using ResultSet in JDBC

We know that ResultSet objects are used to get the data that is retrieved using a Select statement. ResultSet can also be used to insert or update records in the database. Steps to remember when you update Record using ResultSet in JDBC

Read More

Insert Record using ResultSet in JDBC

We know that ResultSet objects are used to get the data that is retrieved using a Select statement. ResultSet can also be used to insert or update records in the database. Steps to remember when you insert Record using ResultSet in JDBC

Read More

ResultSetMetaData in JDBC example

The object of [crayon-5905c0ca14c68108597911-i/] can be used to get the details of the columns available in the ResultSet object. Some of the important methods of ResultSetMetaData are [crayon-5905c0ca14c71256497931/] Lets see ResultSetMetaData in JDBC example using some of the above methods ResultSetMetaData in

Read More

Connect to Oracle Database using JDBC

In this post we will see the sample code to connect to Oracle Database using JDBC drivers in java. For connecting to Oracle database we will need the following 1. Connection URL The format is [crayon-5905c0ca151ec827661117-i/] example: [crayon-5905c0ca151f5485230133-i/] 2. User Name User

Read More

Difference between Statement PreparedStatement and CallableStatement

Statement PreparedStatement and CallableStatement are interfaces of JDBC that are used to interact with the Database, either to execute the insert’s, updates, deletes or to call a stored procedure or to get data. Lets see the difference between Statement PreparedStatement and CallableStatement.

Read More

CallableStatement example with IN OUT parameters

CallableStatement in JDBC is used to execute Stored Procedures. A Stored Procedure can have 3 types of parameters 1. IN – is input parameter to the procedure 2. OUT – is output parameter returning from procedure 3. INOUT – acts as both

Read More

Batch Processing using Prepared Statement in Java

Batch processing is a feature in JDBC used to club multiple SQLs and send it to database in one call. You can get more details on Batch Processing here Advantages of Batch processing 1. Performance Batch processing can reduce a lot of

Read More

Delete 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 parameters in query dynamically. Steps to Delete record using Prepared Statement 1. Get a

Read More