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 <dfields-pg-jdbc@pexicom.com> 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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy