Skip to content

'Invalid column type' exception generated when writing a Boolean data member to Oracle database [SPR-14581] #19150

Closed
@spring-projects-issues

Description

@spring-projects-issues

Ionut Gradinaru opened SPR-14581 and commented

Spring JDBC uses StatementCreatorUtils to identify the mapping between Java data types and the SQL data types when persisting DOs using BeanPropertySqlParameterSource for DO to table mapping. The data type mappings are hard coded in StatementCreatorUtils and the following new mapping have been added starting from v 4.2.3:
javaTypeToSqlTypeMap.put(boolean.class, Types.BOOLEAN);
javaTypeToSqlTypeMap.put(Boolean.class, Types.BOOLEAN);
The Oracle JDBC driver does not know how to handle Types.BOOLEAN for the target DB column, so we get the ‘java.sql.SQLException: Invalid column type’ when trying to write a DO which has a boolean data member
To bypass this issue in the application domain, the hard coded data type map defined in StatementCreatorUtils may updated by removing the faulty mappings using reflection.
Please consider addressing this issue in the framework domain too.


Affects: 4.2.4

Issue Links:

Metadata

Metadata

Assignees

Labels

in: dataIssues in data modules (jdbc, orm, oxm, tx)status: duplicateA duplicate of another issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions