Usually, the JdbcType#getJdbcTypeCode is only used for binding null and all other code that wants to know the “type” of a JdbcType will use getDefaultSqlTypeCode. When emulating certain types like JSON through a CLOB on databases that do not have a native JSON type, the “logical type” and DDL type will differ. For some code it is important to understand that the DDL type of something is a CLOB though, so it is desirable to query the DDL type separately. My proposal is to add a new method {{default int getDdlTypeCode() { return getDefaultSqlTypeCode(); } }} and override this method for JdbcType implementations that do such an emulation. |