Host variables in Structured Query Language for Java

Arguments to embedded SQL statements are passed through host variables. Host variables are variables of the host language, and they can appear in SQL statements.

Host variables have up to three parts:

The evaluation of a Java identifier does not have side effects in a Java program, so it may appear multiple times in the Java code generated to replace an SQLJ clause.

The following query contains the host variable, :x. This host variable is the Java variable, field, or parameter x that is visible in the scope containing the query.

SELECT COL1, COL2 FROM TABLE1 WHERE :x > COL3