--- jch <[EMAIL PROTECTED]> wrote:
> Are the getDate, getTime and getTimestamp JDBC methods supported?
> Whenever I use the getDate method it returns a value of "1969-12-31".
> In addition, one of my date columns is null and the getDate method
> still returns "1969-12-31" instead of null. Am I doing something
> wrong? I am using version 037. Thanks.
As sqlite3 does not have a date type, different sqlite wrapper authors
choose different conventions to represent dates. Some use strings, others
use julian days since year 0, others use milliseconds since the UNIX epoch
(Jan 1, 1970 00:00 GMT). sqlitejdbc uses the latter form for getDate
and getTimestamp.
The jdbc driver source code is very straightforward. If you want a
different date convention, just change RS.java in your local copy:
public Date getDate(int col) throws SQLException {
return new Date(db.column_long(pointer, markCol(col))); }
public Date getDate(int col, Calendar cal) throws SQLException {
if (cal == null) return getDate(col);
cal.setTimeInMillis(db.column_long(pointer, markCol(col)));
return new Date(cal.getTime().getTime());
}
public Date getDate(String col) throws SQLException {
return getDate(findColumn(col), Calendar.getInstance()); }
public Date getDate(String col, Calendar cal) throws SQLException {
return getDate(findColumn(col), cal); }
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
--~--~---------~--~----~------------~-------~--~----~
Mailing List: http://groups.google.com/group/sqlitejdbc?hl=en
To unsubscribe, send email to [EMAIL PROTECTED]
-~----------~----~----~----~------~----~------~--~---