|
From: <jue...@we...> - 2004-08-31 22:15:01
|
Good point. However, the driver respectively database might behave = differently, as the passed-in object implicitly leads to a corresponding = SQL type (i.e. DATE or TIMESTAMP): Will the database complain if it = receives a timestamp value for a date field? Will it complain the other = way round? =20 It's certainly recommendable to pass the SQL type in for such a value. = The question is: What's the safest default for the type if we receive a = plain java.util.Date? Which implicit SQL type will work with most = databases in a predictable manner? =20 Juergen =20 ________________________________ Von: spr...@li... im Auftrag = von tho...@tr... Gesendet: Di 31.08.2004 22:56 An: spr...@li... Betreff: Re: [Springframework-developer] StatementCreatorUtils Wouldn't java.sql.Timestamp be a better choice for java.util.Date and java.util.Calendar with unknow SQL type? That way you would not lose = the time portion. Thomas Quoting "j=FCrgen h=F6ller [werk3AT]" <jue...@we...>: > I've adapted StatementCreatorUtils as follows: > > * StatementCreatorUtils uses specific PreparedStatement parameter = setter =3D > methods, as far as possible > * added auto-conversion of java.util.Calendar to =3D > java.sql.Date/Time/Timestamp, for SQL types DATE/TIME/TIMESTAMP > * added auto-conversion of java.util.Date and java.util.Calendar to = =3D > java.sql.Date, in case of an unknown SQL type > > This was partly triggered by > http://opensource.atlassian.com/projects/spring/browse/SPR-301 > > Thomas and co, please give the new version a try. It should = essentially =3D > work the same as before, just do a few more auto-conversions. > > Juergen > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_id=3D5047&alloc_id=3D10808&op=3Dclick > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > ------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=3D5047&alloc_id=3D10808&op=3Dclick _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |