From: Roland Walter <rwa@mosaic-ag.com>
To: Jason Tesser <jtesser@nbbc.edu>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: problem with types in new jdbc driver
Date: Tue, 21 Jun 2005 15:15:59 +0200
Message-ID: <42B8130F.5000604@mosaic-ag.com> (raw)
In-Reply-To: <1119358451.5337.3.camel@jtessermain>
References: <1119358451.5337.3.camel@jtessermain>
Jason Tesser schrieb:
> I had posted this on the main postgres list and here is what Richard
> Huxton said. I was wondering if one you you guys could shed some more
> light on this for me. What has changed between the 7.4 driver and the
> 8.0 driver to cause this problem?
>
The JDBC driver 8.0 uses real prepared statements of the database
server. To do this the client-server protocol V3 is used, which needs to
know the real type of a parameter. So you must use setString only with
character values, setTimestamp with timestamp values, setLong with
BIGINT and so on.
The 7.4 JDBC driver did not use real prepared statements, it replaced
the parameters on the client side.
If you want to use setString with the 8.0 driver with timestamp values,
you have to write the cast into the statement string. To be more
compatible with other databases replace the setString with the
set-method that fits the type and convert the String to a
java.sql.Timestamp before.
--
Roland Walter
MOSAIC SOFTWARE AG
Telefon: 02225/882-411 Fax: 02225/882-201
http://www.mosaic-ag.com
------- L E G A L D I S C L A I M E R ---------
Die Informationen in dieser Nachricht sind vertraulich
und ausschliesslich fuer den Adressaten bestimmt.
Kenntnisnahme durch Dritte ist unzulaessig. Die
Erstellung von Kopien oder das Weiterleiten an weitere,
nicht originaere und benannte Adressaten ist nicht
vorgesehen und kann ungesetzlich sein. Die Meinungen
in dieser Nachricht stellen lediglich die Meinungen
des Senders dar. Falls Sie vermuten, dass diese
Nachricht veraendert wurde, setzen Sie sich mit dem
Absender in Verbindung. Der Absender uebernimmt ohne
weitere Ueberpruefung keine Verantwortung fuer die
Richtigkeit und Vollstaendigkeit des Inhalts. Unbefugte
Empfaenger werden gebeten, die Vertraulichkeit der
Nachricht zu wahren und den Absender sofort ueber
einen Uebertragungsfehler zu informieren.
------------------------------------------------------
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: rwa@mosaic-ag.com, jtesser@nbbc.edu
Subject: Re: problem with types in new jdbc driver
In-Reply-To: <42B8130F.5000604@mosaic-ag.com>
References: <1119358451.5337.3.camel@jtessermain> <42B8130F.5000604@mosaic-ag.com>
* 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