Skip to content

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

Closed

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:

Activity

  1. spring-projects-issues commented on Aug 11, 2016

    @spring-projects-issues
    CollaboratorAuthor

    Juergen Hoeller commented

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

  2. added
    type: bug
    in: data
    status: duplicate
    on Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: datastatus: duplicate

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions