How to select single or multiple records using JDBC executeQuery() and executeQueryForList()

Here we will discuss how to select single or multiple records using JDBC API. To select single record from database we use executeQuery() and to select multiple records we use executeQueryForList(). You may need to use executeQuery() to fetch single record from the database for various reasons, such as: You want to see details for a particular record You want to update a particular record You want to check whether the record exists or not

Continue