One question about connection parameter stringtype

From: 夏 <kavi314(at)icloud(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: One question about connection parameter stringtype
Date: 2014-05-29 09:31:09
Message-ID: AA382F9E-6710-4606-8F5C-E76B9A5F8E0F@icloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi,

When i run my program which use pgjdbc,a error happened.

my program looks like the following:

PreparedStatement pstmt = con.prepareStatement("select 1=?");
pstmt.setString(1, null);
pstmt.executeUpdate();

error message:
operator does not exist: integer = character varying

The error's resean is just as the error message said, and i known this can be avoided
by set stringtype=unspecified in url. But i still have two question。

1)when stringtype is setted to be "unspecified",is there any bad think would happen?

2)If the answer of 1)is "nothing",why pgjdbc not setting the default value of stringtype to "unspecified"

kavi314

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2014-05-29 10:25:40 Re: getFastLong gets longs slowly
Previous Message Mikko Tiihonen 2014-05-29 08:46:12 Re: getFastLong gets longs slowly