Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spring-projects-issues opened this issue Aug 11, 2016 · 1 comment
Assignees
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) status: duplicate A duplicate of another issue

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Aug 11, 2016

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:

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Aug 11, 2016

Juergen Hoeller commented

This looks like a duplicate of #18688 and should therefore be fixed in 4.2.6+ already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

2 participants