This documentation is for the unreleased development version of jOOQ. Click on the above version links to get this documentation for a supported version of jOOQ.
JSR 310 type binding
Supported by ✅ Open Source Edition ✅ Express Edition ✅ Professional Edition ✅ Enterprise Edition
Historically, JDBC drivers had poor support for the java.time (JSR 310) types, which is why jOOQ encodes some of them in a more compatible way when binding them to JDBC statements. Most modern drivers support these types natively, and binding them natively may perform better both on the client and on the server. The following settings govern this behaviour:
-
bindOffsetDateTimeType: Whetherjava.time.OffsetDateTimevalues are bound natively usingPreparedStatement.setObject(). The default isfalse, in case of which jOOQ binds them as formatted strings in many dialects. -
bindOffsetTimeType: Whetherjava.time.OffsetTimevalues are bound natively usingPreparedStatement.setObject(). The default isfalse, in case of which jOOQ binds them as formatted strings in many dialects. -
bindLocalTimeType: Whetherjava.time.LocalTimevalues are bound natively. The default istrue. If set tofalse, jOOQ reverts to the behaviour prior to jOOQ 3.21, bindingjava.sql.Timevalues instead, which truncates fractional seconds. Dialects that don't support bindingLocalTimenatively always use the legacy behaviour.
See also the manual's sections about the OffsetDateTime and OffsetTime data types.
Example configuration
Settings settings = new Settings()
.withBindOffsetDateTimeType(true) // Defaults to false
.withBindOffsetTimeType(true) // Defaults to false
.withBindLocalTimeType(false); // Defaults to true
Feedback
Do you have any feedback about this page? We'd love to hear it!