From: Assad Jarrahian <jarraa@gmail.com>
To: pgsql-jdbc@postgresql.org
Subject: Prepared statements and default values
Date: Mon, 9 Jan 2006 20:24:37 -0700
Message-ID: <4bd3e1480601091924q54cfee5cs1c6744638e650fff@mail.gmail.com> (raw)
I have a preparedStatement with the following query
"UPDATE usersettings SET gpsfrequency = ? , serverurl = ? where
username = ? ;";
In the db, the table userSettings has a default value specified for
gps_frequency .
So when I write code
if (client.getSettings().getField(Settings.GPS_FREQUENCY).compareTo(""))==0)
<what goes here> //pick up the default value from the db.
else
setUserSettings.setInt(++i,
Integer.parseInt(client.getSettings().getField(Settings.GPS_FREQUENCY)));
<what goes here> .. I basically want to send something that lets the
db know to use the DEFAULT value. (its of type int0)
So what does go here?
any help would be much appreciated.
-a
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: jarraa@gmail.com
Subject: Re: Prepared statements and default values
In-Reply-To: <4bd3e1480601091924q54cfee5cs1c6744638e650fff@mail.gmail.com>
References: <4bd3e1480601091924q54cfee5cs1c6744638e650fff@mail.gmail.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