mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-03-13 19:57:53 +08:00
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
This commit is contained in:
parent
78b13fee45
commit
30c2b5ec72
@ -13,7 +13,7 @@ import org.postgresql.largeobject.*;
|
||||
import org.postgresql.util.PGbytea;
|
||||
import org.postgresql.util.PSQLException;
|
||||
|
||||
/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1ResultSet.java,v 1.6 2002/09/06 21:23:06 momjian Exp $
|
||||
/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1ResultSet.java,v 1.7 2002/10/19 22:10:36 barry Exp $
|
||||
* This class defines methods of the jdbc1 specification. This class is
|
||||
* extended by org.postgresql.jdbc2.AbstractJdbc2ResultSet which adds the jdbc2
|
||||
* methods. The real ResultSet class (for jdbc1) is org.postgresql.jdbc1.Jdbc1ResultSet
|
||||
@ -646,6 +646,10 @@ public abstract class AbstractJdbc1ResultSet
|
||||
if (wasNullFlag)
|
||||
return null;
|
||||
|
||||
// if we don't have at least 2 characters it can't be money.
|
||||
if (s.length() < 2)
|
||||
return s;
|
||||
|
||||
// Handle Money
|
||||
if (s.charAt(0) == '(')
|
||||
{
|
||||
@ -655,6 +659,10 @@ public abstract class AbstractJdbc1ResultSet
|
||||
{
|
||||
s = s.substring(1);
|
||||
}
|
||||
else if (s.charAt(0) == '-' && s.charAt(1) == '$')
|
||||
{
|
||||
s = "-" + s.substring(2);
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user