From 7036ca447275bf668947bc6d910329d194e7d272 Mon Sep 17 00:00:00 2001 From: Kris Jurka Date: Sun, 20 Mar 2011 00:58:53 +0000 Subject: [PATCH] Allow the driver to support setObject with Types.DISTINCT. We report metadata indicating that values are of this type, so we'd better accept it coming back in. Reported by Vitalii Tymchyshyn. --- org/postgresql/jdbc2/AbstractJdbc2Statement.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/org/postgresql/jdbc2/AbstractJdbc2Statement.java b/org/postgresql/jdbc2/AbstractJdbc2Statement.java index e91c9e320..93bffa55d 100644 --- a/org/postgresql/jdbc2/AbstractJdbc2Statement.java +++ b/org/postgresql/jdbc2/AbstractJdbc2Statement.java @@ -3,7 +3,7 @@ * Copyright (c) 2004-2008, PostgreSQL Global Development Group * * IDENTIFICATION -* $PostgreSQL: pgjdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java,v 1.107.2.3 2009/09/26 15:21:34 jurka Exp $ +* $PostgreSQL: pgjdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java,v 1.107.2.4 2010/05/01 16:08:04 jurka Exp $ * *------------------------------------------------------------------------- */ @@ -1687,6 +1687,9 @@ public void setObject(int parameterIndex, Object in, int targetSqlType, int scal else throw new PSQLException(GT.tr("Cannot cast an instance of {0} to type {1}", new Object[]{in.getClass().getName(),"Types.ARRAY"}), PSQLState.INVALID_PARAMETER_TYPE); break; + case Types.DISTINCT: + bindString(parameterIndex, in.toString(), Oid.UNSPECIFIED); + break; case Types.OTHER: if (in instanceof PGobject) setPGobject(parameterIndex, (PGobject)in);