diff options
author | Peter Mount <peter@retep.org.uk> | 1999-06-27 11:05:38 +0000 |
---|---|---|
committer | Peter Mount <peter@retep.org.uk> | 1999-06-27 11:05:38 +0000 |
commit | e70b4831d7f5c22d7d68bc7bb5d14a0a3554c3e6 (patch) | |
tree | c7394ea6f65538b596f4509fbfa27ba5cdddddad /src/interfaces/jdbc/postgresql/jdbc1/ResultSet.java | |
parent | fe90c54800a2e6799664f372a8636adbb1fc5a06 (diff) |
Some minor bug fixes
Diffstat (limited to 'src/interfaces/jdbc/postgresql/jdbc1/ResultSet.java')
-rw-r--r-- | src/interfaces/jdbc/postgresql/jdbc1/ResultSet.java | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/src/interfaces/jdbc/postgresql/jdbc1/ResultSet.java b/src/interfaces/jdbc/postgresql/jdbc1/ResultSet.java index fca14e64d92..1ee24a8e29f 100644 --- a/src/interfaces/jdbc/postgresql/jdbc1/ResultSet.java +++ b/src/interfaces/jdbc/postgresql/jdbc1/ResultSet.java @@ -434,24 +434,16 @@ public class ResultSet extends postgresql.ResultSet implements java.sql.ResultSe public Timestamp getTimestamp(int columnIndex) throws SQLException { String s = getString(columnIndex); + if(s==null) + return null; + SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:sszzz"); - if (s != null) - { - int TZ = new Float(s.substring(19)).intValue(); - TZ = TZ * 60 * 60 * 1000; - TimeZone zone = TimeZone.getDefault(); - zone.setRawOffset(TZ); - String nm = zone.getID(); - s = s.substring(0,19) + nm; - try { - java.util.Date d = df.parse(s); - return new Timestamp(d.getTime()); - } catch (ParseException e) { - throw new PSQLException("postgresql.res.badtimestamp",new Integer(e.getErrorOffset()),s); - } - } - return null; // SQL NULL + try { + return new Timestamp(df.parse(s).getTime()); + } catch(ParseException e) { + throw new PSQLException("postgresql.res.badtimestamp",new Integer(e.getErrorOffset()),s); + } } /** |