postgresql-jdbc.git / summary / log / commit / refs
commit 10c411239b4fb26cecd62d81fd5f673a67f22cbb
Author: Dave Cramer <davec@fastcrypt.com>
Date: Tue Mar 05 03:46:03 2002 +0000
Doug Fields patch to prevent exception being thrown on zero length arrays
org/postgresql/jdbc2/Array.java | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/org/postgresql/jdbc2/Array.java b/org/postgresql/jdbc2/Array.java
index 14948e5b..f68106ee 100644
--- a/org/postgresql/jdbc2/Array.java
+++ b/org/postgresql/jdbc2/Array.java
@@ -74,7 +74,13 @@ public class Array implements java.sql.Array
Object retVal = null;
ArrayList array = new ArrayList();
- if ( rawString != null )
+
+ /* Check if the String is also not an empty array
+ * otherwise there will be an exception thrown below
+ * in the ResultSet.toX with an empty string.
+ * -- Doug Fields <dfields-pg-jdbc@pexicom.com> Feb 20, 2002 */
+
+ if ( rawString != null && !rawString.equals("{}") )
{
char[] chars = rawString.toCharArray();
StringBuffer sbuf = new StringBuffer();
[parent: 4414db538021]