pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
boolean problem
4+ messages / 2 participants
[nested] [flat]

* boolean problem
@ 2004-10-18 17:10 Tony Grant <tony@tgds.net>
  2004-10-18 19:18 ` Re: boolean problem Kris Jurka <books@ejurka.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Tony Grant @ 2004-10-18 17:10 UTC (permalink / raw)
  To: pgsql-jdbc

Hello again =:-D

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?

TIA

Tony Grant
 

-- 
www.tgds.net Library management software toolkit





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: boolean problem
  2004-10-18 17:10 boolean problem Tony Grant <tony@tgds.net>
@ 2004-10-18 19:18 ` Kris Jurka <books@ejurka.com>
  2004-10-19 12:52   ` Re: boolean problem Tony Grant <tony@tgds.net>
  0 siblings, 1 reply; 4+ messages in thread

From: Kris Jurka @ 2004-10-18 19:18 UTC (permalink / raw)
  To: Tony Grant <tony@tgds.net>; +Cc: pgsql-jdbc



On Mon, 18 Oct 2004, Tony Grant wrote:

> Hello again =:-D
> 
> 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?

Kris Jurka



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: boolean problem
  2004-10-18 17:10 boolean problem Tony Grant <tony@tgds.net>
  2004-10-18 19:18 ` Re: boolean problem Kris Jurka <books@ejurka.com>
@ 2004-10-19 12:52   ` Tony Grant <tony@tgds.net>
  2004-10-19 17:00     ` Re: boolean problem Kris Jurka <books@ejurka.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Tony Grant @ 2004-10-19 12:52 UTC (permalink / raw)
  To: Kris Jurka <books@ejurka.com>; +Cc: pgsql-jdbc

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





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: boolean problem
  2004-10-18 17:10 boolean problem Tony Grant <tony@tgds.net>
  2004-10-18 19:18 ` Re: boolean problem Kris Jurka <books@ejurka.com>
  2004-10-19 12:52   ` Re: boolean problem Tony Grant <tony@tgds.net>
@ 2004-10-19 17:00     ` Kris Jurka <books@ejurka.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Kris Jurka @ 2004-10-19 17:00 UTC (permalink / raw)
  To: Tony Grant <tony@tgds.net>; +Cc: pgsql-jdbc



On Tue, 19 Oct 2004, Tony Grant wrote:

> <% if ((((howmanyworks_data = howmanyworks.getObject("works"))==null ||
> howmanyworks.wasNull())?"":howmanyworks_data)) { // Adv Conditional
> Region %>
> 
> incompatible types
> found   : java.lang.String
> required: boolean
> 

This is a Java error, not a postgresql error.  The following statement is
being used as a boolean value, but one half returns a String and the other
an Object, neither is a boolean.

if ( (<null check>)?"":howmanyworks_data) {

Kris Jurka



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2004-10-19 17:00 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-10-18 17:10 boolean problem Tony Grant <tony@tgds.net>
2004-10-18 19:18 ` Kris Jurka <books@ejurka.com>
2004-10-19 12:52   ` Tony Grant <tony@tgds.net>
2004-10-19 17:00     ` Kris Jurka <books@ejurka.com>

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