Re: issuing insert preparedstatement queries with default values

From: Lew <noone(at)lwsc(dot)ehost-services(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: issuing insert preparedstatement queries with default values
Date: 2010-01-30 21:11:04
Message-ID: hk2798$iq7$2@news.albasani.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Johnny Luong wrote:
> |> Is there a way to use the DEFAULT per column value on an INSERT sql in
> |> PG through the PreparedStatement JDBC API? It'd be nice so that I don't
> |> have to maintain a secondary list of PreparedStatements or a list of
> |> default values maintained outside of the database definition.
...
> | TableEntryForm addUpdateTableEntry() Connection Created
> | INSERT INTO "public"."key_table4" ("avatar_id", "user_id", "bing_id")
> | VALUES (?, ?, default)
> | TableEntryForm addUpdateTableEntry() Connection Closed

I just leave out the columns in the INSERT for which I want default values.

--
Lew

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Richard Troy 2010-01-30 23:44:06 driver initialization and connection separation
Previous Message Sven Hafner 2010-01-30 13:35:20 Re: Is there a schema parameter for the jdbc URL ?