K
K S Aldebaraan
I'm calling the getDate() method on a ResultSet to get data that has
been pulled from a PostgreSQL database. The datatype in the db is
int8, and i'm just calling getDate because I'm assuming these are
equivalent.
I've already tried using the date, timestamp, and numeric datatypes,
and I'm not understanding why none will work. Here is my piece of
code (from DBEvent.java) that makes the attempt to get the data:
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM Events WHERE
eventid='" + eventid + "'");
if (rs.next()) {
this.duedate = rs.getDate("duedate");
....etc, etc, etc.
And here's the pertinent stack trace:
Embedded exception is:
java.lang.IllegalArgumentException
at java.sql.Date.valueOf(Date.java:100)
at org.postgresql.jdbc1.AbstractJdbc1ResultSet.toDate(AbstractJdbc1ResultSet.java:789)
at org.postgresql.jdbc1.AbstractJdbc1ResultSet.getDate(AbstractJdbc1ResultSet.java:228)
at org.postgresql.jdbc1.AbstractJdbc1ResultSet.getDate(AbstractJdbc1ResultSet.java:388)
at db.DBEvent.<init>(DBEvent.java:54)
at db.DBJob.getJobEvents(DBJob.java:85)
at data.Tester.testUsers(Tester.java:147)
at data.Tester.main(Tester.java:223)
been pulled from a PostgreSQL database. The datatype in the db is
int8, and i'm just calling getDate because I'm assuming these are
equivalent.
I've already tried using the date, timestamp, and numeric datatypes,
and I'm not understanding why none will work. Here is my piece of
code (from DBEvent.java) that makes the attempt to get the data:
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM Events WHERE
eventid='" + eventid + "'");
if (rs.next()) {
this.duedate = rs.getDate("duedate");
....etc, etc, etc.
And here's the pertinent stack trace:
Embedded exception is:
java.lang.IllegalArgumentException
at java.sql.Date.valueOf(Date.java:100)
at org.postgresql.jdbc1.AbstractJdbc1ResultSet.toDate(AbstractJdbc1ResultSet.java:789)
at org.postgresql.jdbc1.AbstractJdbc1ResultSet.getDate(AbstractJdbc1ResultSet.java:228)
at org.postgresql.jdbc1.AbstractJdbc1ResultSet.getDate(AbstractJdbc1ResultSet.java:388)
at db.DBEvent.<init>(DBEvent.java:54)
at db.DBJob.getJobEvents(DBJob.java:85)
at data.Tester.testUsers(Tester.java:147)
at data.Tester.main(Tester.java:223)