JDBC Tutorials - Herong's Tutorial Notes
Dr. Herong Yang, Version 2.11

Microsoft JDBC Driver - Query Statements and Result Sets

This chapter provides tutorial notes on running query statements and working with result sets with Microsoft JDBC Driver. Topics include creating statement objects; executing SQL query statements; retrieving ResultSet objects; looping through result set; obtaining field values from the result sets.

Commonly Used JDBC Class Methods

Calling createStatement() and executeQuery

Receiving ResultSet Objects from executeQuery

Closing ResultSet Objects - res.close()

Looping through ResultSet with res.next()

Retrieving Field Values using res.get*() Methods

Using ResultSetMetaData Objects to List All Fields

Dr. Herong Yang, updated in 2007
Microsoft JDBC Driver - Query Statements and Result Sets