You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Roman Zamorski <ra...@tenbit.pl> on 2001/01/29 16:18:46 UTC
java.sql.Date & esql
hello,
I've just encountered a problem, which seems very difficult to solve. I have
DATETIME field in the database containing date of entry event. Now when I
wanted to insert a current date it turned out, that both java.*.Date
constructors set time to zero! I've surpassed this 'thing' by building part
of the query in string and it actually works. The real problem is when I
want the date back [from DB]. It seems that ResultSet.getDate() method,
which is used by esql, calls the bloody java.sql.Date constructor, zeroing
the time part of the date again! I'm quite confused what to do now. Is there
any way I could get proper date & time from the database? Anyone has an
idea?
thanks,
roman.
Re: java.sql.Date & esql
Posted by Donald Ball <ba...@webslingerZ.com>.
On Mon, 29 Jan 2001, Roman Zamorski wrote:
> I've just encountered a problem, which seems very difficult to solve. I have
> DATETIME field in the database containing date of entry event. Now when I
> wanted to insert a current date it turned out, that both java.*.Date
> constructors set time to zero! I've surpassed this 'thing' by building part
> of the query in string and it actually works. The real problem is when I
> want the date back [from DB]. It seems that ResultSet.getDate() method,
> which is used by esql, calls the bloody java.sql.Date constructor, zeroing
> the time part of the date again! I'm quite confused what to do now. Is there
> any way I could get proper date & time from the database? Anyone has an
> idea?
try get-timestamp. or just use get-string.
- donald
Re: SV: java.sql.Date & esql
Posted by Roman Zamorski <ra...@tenbit.pl>.
I'm using mysql with gjt.mm.mysql driver...
> This is most propably i problem of the jdbc-driver of your database.
> Which database are you using ?
> There a so many databases out there that cant handle the Date right or at
all.
>
> Markus
>
> Pal Wester wrote:
>
> > Why not use the database own formattingfunction and use get-string
> > instead??
> >
> > this isn't the greatest sollution, but it wil work....
> >
> > -----Opprinnelig melding-----
> > Fra: Roman Zamorski [mailto:ramzam@tenbit.pl]
> > Sendt: 29. januar 2001 16:19
> > Til: cocoon-users@xml.apache.org
> > Emne: java.sql.Date & esql
> >
> > hello,
> >
> > I've just encountered a problem, which seems very difficult to solve. I
have
> > DATETIME field in the database containing date of entry event. Now when
I
> > wanted to insert a current date it turned out, that both java.*.Date
> > constructors set time to zero! I've surpassed this 'thing' by building
part
> > of the query in string and it actually works. The real problem is when I
> > want the date back [from DB]. It seems that ResultSet.getDate() method,
> > which is used by esql, calls the bloody java.sql.Date constructor,
zeroing
> > the time part of the date again! I'm quite confused what to do now. Is
there
> > any way I could get proper date & time from the database? Anyone has an
> > idea?
> >
> > thanks,
> > roman.
> >
> > ---------------------------------------------------------------------
> > Please check that your question has not already been answered in the
> > FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> >
> > To unsubscribe, e-mail: <co...@xml.apache.org>
> > For additional commands, e-mail: <co...@xml.apache.org>
> >
> > ---------------------------------------------------------------------
> > Please check that your question has not already been answered in the
> > FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> >
> > To unsubscribe, e-mail: <co...@xml.apache.org>
> > For additional commands, e-mail: <co...@xml.apache.org>
>
----------------------------------------------------------------------------
----
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
Re: SV: java.sql.Date & esql
Posted by Markus Bernhardt <mb...@swsgmbh.de>.
This is most propably i problem of the jdbc-driver of your database.
Which database are you using ?
There a so many databases out there that cant handle the Date right or at all.
Markus
Pal Wester wrote:
> Why not use the database own formattingfunction and use get-string
> instead??
>
> this isn't the greatest sollution, but it wil work....
>
> -----Opprinnelig melding-----
> Fra: Roman Zamorski [mailto:ramzam@tenbit.pl]
> Sendt: 29. januar 2001 16:19
> Til: cocoon-users@xml.apache.org
> Emne: java.sql.Date & esql
>
> hello,
>
> I've just encountered a problem, which seems very difficult to solve. I have
> DATETIME field in the database containing date of entry event. Now when I
> wanted to insert a current date it turned out, that both java.*.Date
> constructors set time to zero! I've surpassed this 'thing' by building part
> of the query in string and it actually works. The real problem is when I
> want the date back [from DB]. It seems that ResultSet.getDate() method,
> which is used by esql, calls the bloody java.sql.Date constructor, zeroing
> the time part of the date again! I'm quite confused what to do now. Is there
> any way I could get proper date & time from the database? Anyone has an
> idea?
>
> thanks,
> roman.
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
Re: SV: java.sql.Date & esql
Posted by Roman Zamorski <ra...@tenbit.pl>.
> Are you sure, the database type DATE has date and time ?
I have database type DATETIME, and when I check with db frontend I can see
that the both date & time are there.
> Have you tried to call getTime(...) to a DATE field ?
nope. i will
> Have you tried to use a TIME database type ?
no again.
thanks,
roman.
>
> Pal Wester wrote:
>
> > Why not use the database own formattingfunction and use get-string
> > instead??
> >
> > this isn't the greatest sollution, but it wil work....
> >
> > -----Opprinnelig melding-----
> > Fra: Roman Zamorski [mailto:ramzam@tenbit.pl]
> > Sendt: 29. januar 2001 16:19
> > Til: cocoon-users@xml.apache.org
> > Emne: java.sql.Date & esql
> >
> > hello,
> >
> > I've just encountered a problem, which seems very difficult to solve. I
have
> > DATETIME field in the database containing date of entry event. Now when
I
> > wanted to insert a current date it turned out, that both java.*.Date
> > constructors set time to zero! I've surpassed this 'thing' by building
part
> > of the query in string and it actually works. The real problem is when I
> > want the date back [from DB]. It seems that ResultSet.getDate() method,
> > which is used by esql, calls the bloody java.sql.Date constructor,
zeroing
> > the time part of the date again! I'm quite confused what to do now. Is
there
> > any way I could get proper date & time from the database? Anyone has an
> > idea?
> >
> > thanks,
> > roman.
> >
> > ---------------------------------------------------------------------
> > Please check that your question has not already been answered in the
> > FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> >
> > To unsubscribe, e-mail: <co...@xml.apache.org>
> > For additional commands, e-mail: <co...@xml.apache.org>
> >
> > ---------------------------------------------------------------------
> > Please check that your question has not already been answered in the
> > FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> >
> > To unsubscribe, e-mail: <co...@xml.apache.org>
> > For additional commands, e-mail: <co...@xml.apache.org>
>
----------------------------------------------------------------------------
----
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
Re: SV: java.sql.Date & esql
Posted by Markus Bernhardt <mb...@swsgmbh.de>.
Are you sure, the database type DATE has date and time ?
Have you tried to call getTime(...) to a DATE field ?
Have you tried to use a TIME database type ?
Markus
Pal Wester wrote:
> Why not use the database own formattingfunction and use get-string
> instead??
>
> this isn't the greatest sollution, but it wil work....
>
> -----Opprinnelig melding-----
> Fra: Roman Zamorski [mailto:ramzam@tenbit.pl]
> Sendt: 29. januar 2001 16:19
> Til: cocoon-users@xml.apache.org
> Emne: java.sql.Date & esql
>
> hello,
>
> I've just encountered a problem, which seems very difficult to solve. I have
> DATETIME field in the database containing date of entry event. Now when I
> wanted to insert a current date it turned out, that both java.*.Date
> constructors set time to zero! I've surpassed this 'thing' by building part
> of the query in string and it actually works. The real problem is when I
> want the date back [from DB]. It seems that ResultSet.getDate() method,
> which is used by esql, calls the bloody java.sql.Date constructor, zeroing
> the time part of the date again! I'm quite confused what to do now. Is there
> any way I could get proper date & time from the database? Anyone has an
> idea?
>
> thanks,
> roman.
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
SV: java.sql.Date & esql
Posted by Pal Wester <pa...@never.no>.
Why not use the database own formattingfunction and use get-string
instead??
this isn't the greatest sollution, but it wil work....
-----Opprinnelig melding-----
Fra: Roman Zamorski [mailto:ramzam@tenbit.pl]
Sendt: 29. januar 2001 16:19
Til: cocoon-users@xml.apache.org
Emne: java.sql.Date & esql
hello,
I've just encountered a problem, which seems very difficult to solve. I have
DATETIME field in the database containing date of entry event. Now when I
wanted to insert a current date it turned out, that both java.*.Date
constructors set time to zero! I've surpassed this 'thing' by building part
of the query in string and it actually works. The real problem is when I
want the date back [from DB]. It seems that ResultSet.getDate() method,
which is used by esql, calls the bloody java.sql.Date constructor, zeroing
the time part of the date again! I'm quite confused what to do now. Is there
any way I could get proper date & time from the database? Anyone has an
idea?
thanks,
roman.
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>