Skip to content
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

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

spring-projects-issues opened this issue Jul 12, 2016 · 1 comment
in: data type: enhancement


Copy link

@spring-projects-issues spring-projects-issues commented Jul 12, 2016

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

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:

  • #17488 Regression in handling of String passed as Types.OTHER to JdbcTemplate
  • #13215 Can't insert into nvarchar2 using SimpleJdbcInsert whereas it works with SimpleJdbcTemplate
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Oct 7, 2017

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
in: data type: enhancement
None yet

No branches or pull requests

1 participant