In the Derby implementation, the JDBC setXXX methods on PreparedStatement does not push/pop the context manager. This is to prevent the driver from getting performance hit. But some of the setXXX methods like, SQLTimestamp.setValue(String theValue), SQLTime.setValue(String theValue), SQLDate.setValue(String theValue) look at the context manager to find out the locale of the database so they can use that locale to do the appropriate conversion from string to date/time/timestamp. But since there is no context setup done for setXXX methods, locale information can't be established by these methods and they do not use the correct locale. This behavior has been around all Derby releases.
More information on this can be found in following thread http://www.nabble.com/PreparedStatement.setXXX-methods-do-not-set-up-ContextStack.-Is-that-right-and-if-so%2C-why--tf3337937.html#a9283354