This is not ideal.

It should be easy to fix if you have a bit of time to test it.

The existing method in RowInputText uses a standard java method:


    protected java.sql.Timestamp readTimestamp()
    throws IOException, HsqlException {

        String s = readString();

        if (s == null) {
            return null;
        }

        return java.sql.Timestamp.valueOf(s);
    }


You can wrap the last line in a try block and catch the exception, then in
the catch block, you can have a second go with a method from HsqlDateTime:

   static Timestamp timestampValue(String s);

This approach will ensure that any existing text file that works will
continue to work, but short, date-only strings will also work..

As this change is small and has predictable impact, it can be included in
the final release.

Fred

----- Original Message ----- 
From: "Blaine Simpson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: 03 June 2004 19:24
Subject: [Hsqldb-developers] date formats in text tables


I notice that with normal JDBC I can insert dates like "2004-06-03" into
timestamp files
(as Strings), but with HSQLDB text files I have to use "2004-06-03
0:0:0" for the same
effect.  "2004-06-03" works fine for date fields, limitations is only
for timestamp fields.

If this is the desired behavior, I'd like to document this in the
Guide.  I'd prefer for it to
have useful defaults like normal JDBC.  I have a purchase date and a
sale date.  I usually
(but not always) do not have the time of day for purchase date.  The
people entering the
data into their spreadsheet have to add " 0:0:0" for every purchase
date, otherwise the
text table chokes when the spreadsheet export is added to the text
file.  (I really don't
want to complicate the procedure by massaging the data in between).

-- 
ICF:  703-934-3692       Cell:  703-944-9317



-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
>From Windows to Linux, servers to mobile, InstallShield X is the one
installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
_______________________________________________
hsqldb-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hsqldb-developers



-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
>From Windows to Linux, servers to mobile, InstallShield X is the one
installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
_______________________________________________
hsqldb-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hsqldb-developers

Reply via email to