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

Commit30c2b5e

Browse files
author
Barry Lind
committed
Applied patch submitted by Kris Jurka to result in a better error message
under some circumstances and handle negative money values better. Modified Files: jdbc/org/postgresql/jdbc1/AbstractJdbc1ResultSet.java
1 parent78b13fe commit30c2b5e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

‎src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1ResultSet.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
importorg.postgresql.util.PGbytea;
1414
importorg.postgresql.util.PSQLException;
1515

16-
/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1ResultSet.java,v 1.6 2002/09/06 21:23:06 momjian Exp $
16+
/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1ResultSet.java,v 1.7 2002/10/19 22:10:36 barry Exp $
1717
* This class defines methods of the jdbc1 specification. This class is
1818
* extended by org.postgresql.jdbc2.AbstractJdbc2ResultSet which adds the jdbc2
1919
* methods. The real ResultSet class (for jdbc1) is org.postgresql.jdbc1.Jdbc1ResultSet
@@ -646,6 +646,10 @@ public String getFixedString(int col) throws SQLException
646646
if (wasNullFlag)
647647
returnnull;
648648

649+
// if we don't have at least 2 characters it can't be money.
650+
if (s.length() <2)
651+
returns;
652+
649653
// Handle Money
650654
if (s.charAt(0) =='(')
651655
{
@@ -655,6 +659,10 @@ public String getFixedString(int col) throws SQLException
655659
{
656660
s =s.substring(1);
657661
}
662+
elseif (s.charAt(0) =='-' &&s.charAt(1) =='$')
663+
{
664+
s ="-" +s.substring(2);
665+
}
658666

659667
returns;
660668
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp