Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite70b483

Browse files
author
Peter Mount
committed
Some minor bug fixes
1 parentfe90c54 commite70b483

File tree

4 files changed

+23
-33
lines changed

4 files changed

+23
-33
lines changed

‎src/interfaces/jdbc/CHANGELOG

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
Sun Jun 27 12:00:00 BST 1999
2+
- Fixed typo in postgresql.Driver that prevented compilation
3+
- Implemented getTimestamp() fix submitted by Philipp Matthias Hahn
4+
<pmhahn@titan.lahn.de>
5+
- Cleaned up some comments in Connection
6+
17
Wed Jun 23 06:50:00 BST 1999
28
- Fixed error in errors.properties where the arguments are 0 based not
39
1 based

‎src/interfaces/jdbc/postgresql/Driver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public java.sql.Connection connect(String url, Properties info) throws SQLExcept
104104
return (java.sql.Connection)con;
105105
}catch(ClassNotFoundExceptionex) {
106106
thrownewPSQLException("postgresql.jvm.version",ex);
107-
}catch(PSQLException(ex1) {
107+
}catch(PSQLExceptionex1) {
108108
// re-throw the exception, otherwise it will be caught next, and a
109109
// postgresql.unusual error will be returned instead.
110110
throwex1;

‎src/interfaces/jdbc/postgresql/jdbc1/ResultSet.java

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -434,24 +434,16 @@ public Time getTime(int columnIndex) throws SQLException
434434
publicTimestampgetTimestamp(intcolumnIndex)throwsSQLException
435435
{
436436
Strings =getString(columnIndex);
437+
if(s==null)
438+
returnnull;
439+
437440
SimpleDateFormatdf =newSimpleDateFormat("yyyy-MM-dd HH:mm:sszzz");
438441

439-
if (s !=null)
440-
{
441-
intTZ =newFloat(s.substring(19)).intValue();
442-
TZ =TZ *60 *60 *1000;
443-
TimeZonezone =TimeZone.getDefault();
444-
zone.setRawOffset(TZ);
445-
Stringnm =zone.getID();
446-
s =s.substring(0,19) +nm;
447-
try {
448-
java.util.Dated =df.parse(s);
449-
returnnewTimestamp(d.getTime());
450-
}catch (ParseExceptione) {
451-
thrownewPSQLException("postgresql.res.badtimestamp",newInteger(e.getErrorOffset()),s);
452-
}
453-
}
454-
returnnull;// SQL NULL
442+
try {
443+
returnnewTimestamp(df.parse(s).getTime());
444+
}catch(ParseExceptione) {
445+
thrownewPSQLException("postgresql.res.badtimestamp",newInteger(e.getErrorOffset()),s);
446+
}
455447
}
456448

457449
/**

‎src/interfaces/jdbc/postgresql/jdbc2/ResultSet.java

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -436,24 +436,16 @@ public Time getTime(int columnIndex) throws SQLException
436436
publicTimestampgetTimestamp(intcolumnIndex)throwsSQLException
437437
{
438438
Strings =getString(columnIndex);
439+
if(s==null)
440+
returnnull;
441+
439442
SimpleDateFormatdf =newSimpleDateFormat("yyyy-MM-dd HH:mm:sszzz");
440443

441-
if (s !=null)
442-
{
443-
intTZ =newFloat(s.substring(19)).intValue();
444-
TZ =TZ *60 *60 *1000;
445-
TimeZonezone =TimeZone.getDefault();
446-
zone.setRawOffset(TZ);
447-
Stringnm =zone.getID();
448-
s =s.substring(0,19) +nm;
449-
try {
450-
java.util.Dated =df.parse(s);
451-
returnnewTimestamp(d.getTime());
452-
}catch (ParseExceptione) {
453-
thrownewPSQLException("postgresql.res.badtimestamp",newInteger(e.getErrorOffset()),s);
454-
}
455-
}
456-
returnnull;// SQL NULL
444+
try {
445+
returnnewTimestamp(df.parse(s).getTime());
446+
}catch(ParseExceptione) {
447+
thrownewPSQLException("postgresql.res.badtimestamp",newInteger(e.getErrorOffset()),s);
448+
}
457449
}
458450

459451
/**

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp