Re: JDBD: time format
- From: "walker.l2" <walker.l2@xxxxxxxxxxxxxx>
- Date: 6 Oct 2005 06:37:59 -0700
How is the time stored in your database? (What SQL / DDS datatype is
the column?)
What might be happening is that if the Stored Procedure is returning
your time as an SQL Date or SQL Time datatype, the ResultSet
implementation might change your getString() call to a
getDate().toString() call or a getTime().toString() call behind the
scenes. The toString() methods of a java.sql.Date and java.sql.Time
will always return a String using a : as the separator.
It would be nice to get to the bottom of this difference between the
two IBM drivers, but two work arounds suggest themselves:
1) Use String's replace() method to convert the :s to .s (not very
elegant)
2) Use getDate or getTime to retrieve the data, then use a
java.text.DateFormat to convert to a String (but this assumes your
Stored Procedure is returning one of these datatypes, and not just
text)
Walker..
.
- Follow-Ups:
- Re: JDBD: time format
- From: Mark
- Re: JDBD: time format
- References:
- JDBD: time format
- From: Mark
- Re: JDBD: time format
- From: walker.l2
- Re: JDBD: time format
- From: Mark
- Re: JDBD: time format
- From: Rodney A. Johnson
- Re: JDBD: time format
- From: walker.l2
- Re: JDBD: time format
- From: Mark
- JDBD: time format
- Prev by Date: Where can i find my File ??
- Next by Date: DSPTAP *print shows conflicting SAVED DATE
- Previous by thread: Re: JDBD: time format
- Next by thread: Re: JDBD: time format
- Index(es):
Relevant Pages
|