Hi,
First of all, thanks for this very useful library !
While trying to adapt simpleorm for use with your driver, I
encountered the following problem :

Timestamp myts;
PrepStmt.setObject(myts) and PrepStmt.setTimestamp(myts) don't do the
same thing !

I think I found the reason :

When setTimestamp is called, you internally call setLong :

public void setTimestamp(int pos, Timestamp x) throws SQLException {
        setLong(pos, x.getTime()); }

This stores Timestamps, Dates, etc. As longs, which is what is
desired.

However, when setObject is called, you just convert the value to
string :

    public void setObject(int pos , Object value) throws SQLException
{
        // TODO: catch wrapped primitives
        batch(pos, value == null ? null : value.toString());
    }

I think you should just check for instances of java.sql.Date and call
setLong accordingly :

    public void setObject(int pos , Object value) throws SQLException
{
        // TODO: catch wrapped primitives
        if (value instanceof java.util.Date) {
          setLong(pos, ((java.util.Date)value).getTime());
        }
        else batch(pos, value == null ? null : value.toString());
    }

Maybe that is what you indended to do by "catch wrapped primitives" ?

Best regards,

Harry

--~--~---------~--~----~------------~-------~--~----~
Mailing List: http://groups.google.com/group/sqlitejdbc?hl=en
To unsubscribe, send email to [EMAIL PROTECTED]
-~----------~----~----~----~------~----~------~--~---

Reply via email to