Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 17b6baf

Browse files
author
Dave Cramer
committed
Doug Fields patch to prevent exception being thrown on zero length arrays
1 parent fe4e95f commit 17b6baf

File tree

1 file changed

+7
-1
lines changed
  • src/interfaces/jdbc/org/postgresql/jdbc2

1 file changed

+7
-1
lines changed

src/interfaces/jdbc/org/postgresql/jdbc2/Array.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,13 @@ public Object getArray(long index, int count, Map map) throws SQLException
7474
Object retVal = null;
7575

7676
ArrayList array = new ArrayList();
77-
if ( rawString != null )
77+
78+
/* Check if the String is also not an empty array
79+
* otherwise there will be an exception thrown below
80+
* in the ResultSet.toX with an empty string.
81+
* -- Doug Fields <[email protected]> Feb 20, 2002 */
82+
83+
if ( rawString != null && !rawString.equals("{}") )
7884
{
7985
char[] chars = rawString.toCharArray();
8086
StringBuffer sbuf = new StringBuffer();

0 commit comments

Comments
 (0)