Available in versions: Dev (3.20)

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.

Fetching trimmed CHAR types

Applies to ✅ Open Source Edition   ✅ Express Edition   ✅ Professional Edition   ✅ Enterprise Edition

Historically, fixed-length CHAR types used to be more present in schemas than the more useful variable length VARCHAR or even TEXT / CLOB types. To support variable length strings inside of CHAR types, strings were typically right-padded with whitespace. This can be annoying in Java based client applications, where the strings have to be trimmed manually, or using SQL RTRIM function calls. Specifically, dictionary views of these RDBMS still use CHAR typed strings very often:

  • Db2
  • Firebird
  • Informix
  • Teradata

To avoid having to manually right-trim these strings, the following Settings can be specified to do this automatically in jOOQ at the JDBC level:

Settings settings = new Settings()
    .withFetchTrimmedCharValues(true); // Default to false

Feedback

Do you have any feedback about this page? We'd love to hear it!

The jOOQ Logo