agora inbox for pljava-dev@postgresql.org
help / color / mirror / Atom feedSubject: [Pljava-dev] ResultSet getString
Date: Thu, 18 May 2006 14:34:16 +0200
Message-ID: <446C69C8.3030908@tada.se> (raw)
In-Reply-To: <e4hmi1$9o3$1@sea.gmane.org>
References: <446C5033.2000508@lewczuk.com>
<446C55FE.2020902@tada.se>
<e4hmi1$9o3$1@sea.gmane.org>
Marek Lewczuk wrote:
> Ok, I thought that getString() will return any postgresql type as string
> - e.g. varchar[] would be {"val","val"}, boolean would be "t" or "f" -
> that is how pgsql works, when assigning value of any type to variable
> defined as text/varchar.
>
>
I see what you mean. Question is, what string representation should be
used? What is more intuitive? Using the Java 'toString()' representation
of an object or the PostgreSQL String representation of the SQL type?
A typical Java developer who's not fluent in PostgreSQL type coercion
would expect that ResultSet.getString() on a boolean would return "true"
or "false", i.e. something that can be passed to Boolean.valueOf(String)
and that Array types would follow the format stipulated by
java.util.Arrays.toString(<type>[]) family of methods.
At present, the getString() method will coerce basic types to strings
using Java semantics. Arrays are not coerced though, since that
functionality was introduced in Java 1.5.
Regards,
Thomas Hallgren
view thread (10+ messages) latest in thread
Message-ID: <446C69C8.3030908@tada.se>
Permalink: ../446C69C8.3030908@tada.se/
Also on: postgresql.org/message-id/446C69C8.3030908@tada.se
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 using the --to and --cc options:
reply via email
To: pljava-dev@postgresql.org
Subject: Re: [Pljava-dev] ResultSet getString
In-Reply-To: <446C69C8.3030908@tada.se>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox