This is most likely due to passing the Date and Timestamp variables as strings to the insert statement.
When you insert or update date or time values, there is a default format in which you can pass these values ββas strings. What you pass in is the idea of ββJava on how to convert dates and timestamps to strings. It seems that these two are not consistent.
It is best to probably use bind variables, then the structure should take care of this.
An alternative would be to use the Oracle to_date () function, where you can specify a format string. Then you define a format string that considers java's way of representing dates as strings. However, I'm not sure if the java view is locale dependent. If so, you will have to write your own date_to_string () method, which always returns dates in the same format, or your program may work on some computers, but not on others with a different locale.
And finally, you can do insert-select, which completely bypasses the java layer.
source share