Problem with fixed length fields.

From: Dave Smith <dave(dot)smith(at)candata(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Problem with fixed length fields.
Date: 2004-10-23 11:54:10
Message-ID: 1098532450.2684.3.camel@davehome
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Platform:
Postgres 7.4.5, lastest JDBC driver from CVS.

Table:
create table t(a char(2),b char(2));
insert into t values (' ',' ');

Jdbc:

This query finds nothing
PreparedStatement st = db.prepareStatement("select * from t where a=?
and b=?");
st.setString(1," ");
st.setString(2," ");
ResultSet rs = st.executeQuery();

This query works
rs = db.prepareStatement("select * from t where a=' ' and b='
'").executeQuery();

Why?

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2004-10-23 17:50:42 Re: Problem with fixed length fields.
Previous Message Kris Jurka 2004-10-22 22:40:49 Re: patch: bring org/postgresql/test/README up to date