Named parameter markers in JDBC applications

You can use named parameter markers instead of standard parameter markers in PreparedStatement and CallableStatement objects to assign values to the input parameter markers. You can also use named parameter markers instead of standard parameter markers in CallableStatement objects to register OUT parameters that have named parameter markers.

SQL strings that contain the following SQL elements can include named parameter markers:

  • CALL
  • DELETE
  • INSERT
  • MERGE
  • PL/SQL block
  • SELECT
  • SET
  • UPDATE

Named parameter markers make your JDBC applications more readable. If you have named parameter markers in an application, set the IBM® Data Server Driver for JDBC and SQLJ Connection or DataSource property enableNamedParameterMarkers to DB2BaseDataSource.YES (1) to direct the driver to accept named parameter markers and send them to the data source as standard parameter markers.