Skip to main content

7. Parameters and Rules

General usage: Parameter Passing and SQL Rules. This table consolidates shared parameter capabilities across APIs. Status links explain datasource-specific differences.

Data sourcePositional parametersNamedText substitutionStatement setterMixed sourcesExplicit typesBinding and reuseGeneral rulesSQL fragment rules
MySQL✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported
PostgreSQL✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported
Oracle✓ Supported◐ Partial✓ Supported✓ Supported✓ Supported✓ Supported◐ Partial✓ Supported✓ Supported
SQL Server✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported
DB2✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported
H2✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported
ClickHouse✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported
Redis◐ Partial✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported◐ Partial✓ Supported✕ Unsupported
MongoDB✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported✕ Unsupported
ES 6✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported✕ Unsupported
ES 7✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported✕ Unsupported
Milvus✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported✓ Supported
  • Positional parameters: bind values by position in programmatic calls and method annotations, including NULL.
  • Named parameters: bind named values from Maps, Beans, and nested properties in programmatic calls, method annotations, and Mapper files.
  • Text substitution: use only trusted identifiers or fragments; bind user-provided values.
  • Mixed sources: combine Array, Bean, and Map parameter sources.
  • Explicit types: specify JDBC types and TypeHandlers through SqlArg.
  • Binding and reuse: PreparedStatement binding, reuse, NULL and empty strings.
  • General rules: select native commands conditionally and bind parameters only in the active branch.
  • SQL fragment rules: generate SQL AND, OR, IN, and SET fragments; not a translation into non-SQL commands.