pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tony Grant <tony@tgds.net>
To: Kris Jurka <books@ejurka.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: boolean problem
Date: Tue, 19 Oct 2004 14:52:36 +0200
Message-ID: <1098190355.26709.31.camel@localhost.localdomain> (raw)
In-Reply-To: <Pine.BSO.4.56.0410181416450.5115@leary.csoft.net>
References: <1098119456.13483.16.camel@localhost.localdomain>
	<Pine.BSO.4.56.0410181416450.5115@leary.csoft.net>

Le lun 18/10/2004 à 21:18, Kris Jurka a écrit :

> > Postgresql 7.3.2 Mac OSX
> > Tomcat 4.1 Mac OSX
> > 
> > My webapp is asking for a boolean and Postgresql is returning "t"
> > interpreted as a string by the application... I though that the JDBC
> > driver took care of little things like that?
> > 
> 
> It is entirely unclear what you are actually doing?  What ResultSet method 
> are you using?  getBoolean, getString, getObject?  How about a couple 
> lines of sample code that show what you are doing, what the result is, and 
> what you expect the result to be?

<%
Driver Driverhowmanyworks =
(Driver)Class.forName(MM_frac_DRIVER).newInstance();
Connection Connhowmanyworks =
DriverManager.getConnection(MM_frac_STRING,MM_frac_USERNAME,MM_frac_PASSWORD);
PreparedStatement Statementhowmanyworks =
Connhowmanyworks.prepareStatement("SELECT count(*)=1 as works  FROM
oeuvre, cree_par, collection  WHERE oeuvre.oeuvre_id =
cree_par.oeuvre_id  AND cree_par.artiste_id = collection.individu_id AND
collection.nom ILIKE '%" + howmanyworks__varNom + "%'");
ResultSet howmanyworks = Statementhowmanyworks.executeQuery();
boolean howmanyworks_isEmpty = !howmanyworks.next();
boolean howmanyworks_hasData = !howmanyworks_isEmpty;
Object howmanyworks_data;
int howmanyworks_numRows = 0;
%>

And in the page

<% if ((((howmanyworks_data = howmanyworks.getObject("works"))==null ||
howmanyworks.wasNull())?"":howmanyworks_data)) { // Adv Conditional
Region %>

incompatible types
found   : java.lang.String
required: boolean

I have tried with boolean but to no avail 

operator == cannot be applied to boolean,

Cheers

Tony Grant

-- 
www.tgds.net Library management software toolkit





view thread (4+ messages)  latest in thread

Message-ID: <1098190355.26709.31.camel@localhost.localdomain>
Permalink:  ../1098190355.26709.31.camel@localhost.localdomain/
Also on:    postgresql.org/message-id/1098190355.26709.31.camel@localhost.localdomain

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: tony@tgds.net, books@ejurka.com
  Subject: Re: boolean problem
  In-Reply-To: <1098190355.26709.31.camel@localhost.localdomain>
  References: <1098119456.13483.16.camel@localhost.localdomain> <Pine.BSO.4.56.0410181416450.5115@leary.csoft.net> <1098190355.26709.31.camel@localhost.localdomain>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox