Well, no, I wish to keep numeric columns as numbers, as I will sometimes be calculating with them. So for now I am following your suggestion only for type java.sql.Timestamp. Right now it's just an aesthetic thing -- checking for that type breaks the symmetry of the code.
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Justin Lee Sent: Thursday, March 23, 2006 4:42 PM To: wicket-user@lists.sourceforge.net Subject: Re: [Wicket-user] displaying java.sql.Timestamp -----BEGIN PGP SIGNED MESSAGE----- Hash: RIPEMD160 If you just want to use the toString() of each element, just add them like: "" + myResultSet.getObject() Frank Silbermann wrote: > I have an application that displays an arbitrary java.sql.ResultSet in a > DataTable. To read each column value I simply call > ?ResultSet.getObject(index)? varying index over the number of columns as > given in the java.sql.ResultSetMetadata. I rely on the DataTable to > create sensible display strings when displaying any of the basic RDBMS > data types. > > > > When the column type is a java.sql.Timestamp, Java?s built-in > .toString() method displays a date and time in a reasonable format > (yyyy-mm-dd hh.mm.ss.xxx?). However, it seems that DataTable does not > rely on Java?s .toString() method; it displays the date portion only > when the datatype is java.sql.Timestamp. > > > > My work-around is to check the type of each Object I read, and if it is > java.sql.Timestamp my IDataProvider computes > myResultSet.getTimestamp(index).toString() instead of simply providing > the result of myResultSet.getObject() as I do for all the other types. > Is this my best solution, or is there a way to configure Wicket or > DataTable to use Java?s default .toString() method when displaying a > java.sql.Timestamp? > > > - -- Justin Lee http://www.antwerkz.com AIM : evan chooly 720.299.0101 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.1 (Cygwin) iD8DBQFEIyQ3JnQfEGuJ90MRA7O/AKDmyXgKRTgTK6coeImXrMb2PfGcTACfY39G 2ugY0Ee2AqdknEUROCJXzFk= =eGSl -----END PGP SIGNATURE----- ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642 _______________________________________________ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user