Hello, we use database (sqlserver) to store values. One of those field is an ivy DateTime. When we try to store it in the database we have this error : com.microsoft.sqlserver.jdbc.SQLServerException: The conversion of a varchar data type to a smalldatetime data type resulted in an out-of-range value. at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216) at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1515) The ivy field is a ch.ivyteam.ivy.scripting.objects.DateTime and it must be stored in a smalldatetime filed from sqlserver (10.50.4000.0). What are we doing wrong ? |
Hi there Possibilities I could think of:
Hi, i've solved this by changing the DateTime to a java.sql.Date. Then I format this date in a string with the right format ("yyyy-MM-dd hh:mm:ss"). It worked well on my dev environment but on the client's TST env, the format was different, days and month were inverted ("yyyy-dd-MM hh:mm:ss") In the futur, what would be an "ivy" standard way to store Date ? Thanks for your answer. Hi what is the language of the MSSQL DB User in use? Have you tried using the jTDS driver for MSSQL? (You can switch the driver in use in the Databases configuration UI) |
Once you sign in you will be able to subscribe for any updates here
By RSS:Markdown Basics
Tags:
Asked: 23.03.2015 at 17:45
Seen: 1,794 times
Last updated: 30.03.2015 at 16:43