Basic HTML version of Foils prepared 7 October 97

Foil 9 SQL Statements

From Overview of JDBC and its use with Microsoft Access ARL Database Tutorial -- February 98. by Nancy McCracken(Sangetta Aggarwal, Udayan Parvate, Tom Pulikal)


createStatement makes an instance of Statement class
  • used for simple SQL statements with no paramters
prepareStatement makes an instance of PreparedStatement class, a subclass of Statement
  • used for SQL statements with one ore more IN parameters
  • or simple SQL statements that are executed frequently
prepareCall makes an instance of CallableStatement
  • used for calls to stored procedures in the database
  • inherits methods for IN parameters from PreparedStatement
  • also has methods for OUT and INOUT parameters
All the above statements are executed in "autocommit" mode for individual SQL statements. Transactions can be programmed with explicit methods commit and rollback.



© on Mon Oct 13 1997