Skip to content

Support for Oracle JDBC connection properties Ex: fixedString [SPR-15391] #19954

Closed as not planned

Description

@spring-projects-issues

Venkata Krishna opened SPR-15391 and commented

Oracle JDBC Connection property fixedString has some significant behavior only when we use PraparedStatement.setObject() is invoked with String value & with UNKNOWN SQL Type.

But this will never happens because of the following code in setValue() method of StatementCreatorUtils.java.

else if (sqlType == SqlTypeValue.TYPE_UNKNOWN) {

     if (isStringValue(inValue.getClass())) {
          ps.setString(paramIndex, inValue.toString());
     }
     else if (isDateValue(inValue.getClass())) {
          ps.setTimestamp(paramIndex, new java.sql.Timestamp(((java.util.Date) inValue).getTime()));
     }
     else if (inValue instanceof Calendar) {
          Calendar cal = (Calendar) inValue;
          ps.setTimestamp(paramIndex, new java.sql.Timestamp(cal.getTime().getTime()), cal);
     }
     else {
          // Fall back to generic setObject call without SQL type specified.
          ps.setObject(paramIndex, inValue);
     }
}  

I think we need to fix this with some special datatype or with special else block code.


Issue Links:

Activity

  1. spring-projects-issues commented on Oct 7, 2017

    @spring-projects-issues
    CollaboratorAuthor

    Juergen Hoeller commented

    TYPE_UNKNOWN is a Spring-specific value, indicating no type specified. I suppose the Oracle driver actually reacts to Types.OTHER there?

  2. added
    in: data
    type: enhancement
    on Jan 11, 2019
  3. removed this from the General Backlog milestone on Dec 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: datatype: enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions