-
Notifications
You must be signed in to change notification settings - Fork 2
Binding Parameters
Philippe Marschall edited this page Oct 22, 2016
·
14 revisions
The following ways to bind parameters are available:
- by index
- by index and type
- by name
- by name and type
per default in parameters are bound by index and out parameters are bound by index and type. The way to bind parameters can be changed by calling the ProcedureCallerFactory#withParameterRegistration
method.
The JDBC types are derived from Java types. The following default mapping is used
Java Type | SQL type |
---|---|
String | VARCHAR |
Integer | INTEGER |
int | INTEGER |
Long | BIGINT |
long | BIGINT |
Short | SMALLINT |
short | SMALLINT |
Byte | TINYINT |
byte | TINYINT |
BigDecimal | NUMERIC |
BigInteger | NUMERIC |
Float | REAL |
float | REAL |
Double | DOUBLE |
double | DOUBLE |
Blob | BLOB |
Clob | CLOB |
NClob | NCLOB |
LocalDate | DATE |
LocalTime | TIME |
LocalDateTime | TIMESTAMP |
OffsetTime | TIME WITH TIMEZONE |
OffsetDateTime | TIMESTAMP WITH TIMEZONE |
java.sql.Date | DATE |
java.sql.Time | TIME |
java.sql.Timestamp | TIMESTAMP |
SQLXML | SQLXML |
Boolean | BOOLEAN |
boolean | BOOLEAN |
If the default implementation is not sufficient a either a custom implementation of TypeMapper
and be passed or the @ParameterType
annotation or the type
attribute on the @OutParameter
and @ReturnValue
annotations can be used.
Note that JDBC requires that a type is always passed when registering an out parameter.
-
Usage
-
Integration