0

Recently we migrated java code to OCI environment from AWS environment. Below is the code which is giving issue.

sql.addSQLToWhereClause(XXXTable, "? between table1.start_date and table1.end_date")
            .addSQLToWhereClause(YYYTable, "table1.ORG_ID = ? ")
            .addSQLToWhereClause(XXXTable, "table1.LANG_CODE = ? ")
            .bind(new Date())
            .bind(ConstValues.ORG_ID)
            .bind(locale.toString().toUpperCase());

In AWS environment it is working fine, but in OCI environment we are getting error: ORA-01830: date format picture ends before converting entire input string

We are getting this error because .bind(new Date()) is putting '07-JAN-2021 10:49:04' in the first parameter. But expected value is '07-JAN-2021'

Please suggest why this additional information is coming in current date and how can we remove it without changing java code.

Thanks Rahul

1 Answers1

0

Object instances of Java's java.util.Date class always had the time portion in it. Why it should behave differently on AWS … – no idea!

But I assume that the implementation of bind(java.util.Date) is different in those environments, because the implementation of Date.toString() will come with a completely different output than that shown in the question.

So please check the version for the library that provides the respective class.

tquadrat
  • 3,033
  • 1
  • 16
  • 29