X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id B908E32A0EC for ; Tue, 19 Oct 2004 13:52:40 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 76972-04 for ; Tue, 19 Oct 2004 12:52:35 +0000 (GMT) Received: from mail.tgds.net (tgds.net [212.100.249.157]) by svr1.postgresql.org (Postfix) with ESMTP id 4E626329F83 for ; Tue, 19 Oct 2004 13:52:37 +0100 (BST) Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail.tgds.net (Postfix) with ESMTP id DA57E1436DB; Tue, 19 Oct 2004 13:52:30 +0100 (BST) Subject: Re: boolean problem From: Tony Grant To: Kris Jurka Cc: pgsql-jdbc@postgresql.org In-Reply-To: References: <1098119456.13483.16.camel@localhost.localdomain> Content-Type: text/plain; charset=ISO-8859-1 Message-Id: <1098190355.26709.31.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-7) Date: Tue, 19 Oct 2004 14:52:36 +0200 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200410/201 X-Sequence-Number: 11306 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