The generated constructor accepts one int formal parameter, according to the external reference declaration. Note that the
parameter's name and its internal name is prim, which is the name that was used in the external reference declaration. The
abstract method getStatement is implemented. The generated code uses prepared statements from the JDBC API, which carries
along benefits, as the extra layer of type safety at compile-time and a transparent performance optimisation at runtime. In
addition, the usage of prepared statements enhances application security and protects the application from injection attacks.
J% uses the type mapping mechanism to enhance the code generation process. The SQL module uses prepared statements
and according to each type it uses the appropriate method from the JDBC API. This is handled automatically by the SQL module,
and the programmer does not need to write anything more than the external reference declaration.
The SQL operator in is a special case. The standard JDBC API does not provide a standard approach on handling this.
Consider the following example: