mirror of
https://github.com/postgres/postgres.git
synced 2025-07-26 01:22:12 +03:00
Some minor bug fixes
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
Sun Jun 27 12:00:00 BST 1999
|
||||||
|
- Fixed typo in postgresql.Driver that prevented compilation
|
||||||
|
- Implemented getTimestamp() fix submitted by Philipp Matthias Hahn
|
||||||
|
<pmhahn@titan.lahn.de>
|
||||||
|
- Cleaned up some comments in Connection
|
||||||
|
|
||||||
Wed Jun 23 06:50:00 BST 1999
|
Wed Jun 23 06:50:00 BST 1999
|
||||||
- Fixed error in errors.properties where the arguments are 0 based not
|
- Fixed error in errors.properties where the arguments are 0 based not
|
||||||
1 based
|
1 based
|
||||||
|
@ -104,7 +104,7 @@ public class Driver implements java.sql.Driver
|
|||||||
return (java.sql.Connection)con;
|
return (java.sql.Connection)con;
|
||||||
} catch(ClassNotFoundException ex) {
|
} catch(ClassNotFoundException ex) {
|
||||||
throw new PSQLException("postgresql.jvm.version",ex);
|
throw new PSQLException("postgresql.jvm.version",ex);
|
||||||
} catch(PSQLException(ex1) {
|
} catch(PSQLException ex1) {
|
||||||
// re-throw the exception, otherwise it will be caught next, and a
|
// re-throw the exception, otherwise it will be caught next, and a
|
||||||
// postgresql.unusual error will be returned instead.
|
// postgresql.unusual error will be returned instead.
|
||||||
throw ex1;
|
throw ex1;
|
||||||
|
@ -434,24 +434,16 @@ public class ResultSet extends postgresql.ResultSet implements java.sql.ResultSe
|
|||||||
public Timestamp getTimestamp(int columnIndex) throws SQLException
|
public Timestamp getTimestamp(int columnIndex) throws SQLException
|
||||||
{
|
{
|
||||||
String s = getString(columnIndex);
|
String s = getString(columnIndex);
|
||||||
|
if(s==null)
|
||||||
|
return null;
|
||||||
|
|
||||||
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:sszzz");
|
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:sszzz");
|
||||||
|
|
||||||
if (s != null)
|
try {
|
||||||
{
|
return new Timestamp(df.parse(s).getTime());
|
||||||
int TZ = new Float(s.substring(19)).intValue();
|
} catch(ParseException e) {
|
||||||
TZ = TZ * 60 * 60 * 1000;
|
throw new PSQLException("postgresql.res.badtimestamp",new Integer(e.getErrorOffset()),s);
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -436,24 +436,16 @@ public class ResultSet extends postgresql.ResultSet implements java.sql.ResultSe
|
|||||||
public Timestamp getTimestamp(int columnIndex) throws SQLException
|
public Timestamp getTimestamp(int columnIndex) throws SQLException
|
||||||
{
|
{
|
||||||
String s = getString(columnIndex);
|
String s = getString(columnIndex);
|
||||||
|
if(s==null)
|
||||||
|
return null;
|
||||||
|
|
||||||
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:sszzz");
|
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:sszzz");
|
||||||
|
|
||||||
if (s != null)
|
try {
|
||||||
{
|
return new Timestamp(df.parse(s).getTime());
|
||||||
int TZ = new Float(s.substring(19)).intValue();
|
} catch(ParseException e) {
|
||||||
TZ = TZ * 60 * 60 * 1000;
|
throw new PSQLException("postgresql.res.badtimestamp",new Integer(e.getErrorOffset()),s);
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user