Select records using Statement in Java

To select records using Statement in java we use

“A ResultSet object maintains a cursor pointing to its current row of data. Initially the cursor is positioned before the first row. The next method moves the cursor to the next row, and because it returns false when there are no more rows in the ResultSet object, it can be used in a while loop to iterate through the result set.”

Example : Select records using Statement in Java

Output

Reference

1. Statement executeQuery()
2. ResultSet

It's only fair to share...Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn