X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 1B09B9DC81A for ; Tue, 21 Feb 2006 05:59:41 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 39447-02 for ; Tue, 21 Feb 2006 05:59:42 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from smtp.uk.colt.net (smtp.uk.colt.net [195.110.64.125]) by postgresql.org (Postfix) with ESMTP id 885539DC811 for ; Tue, 21 Feb 2006 05:59:37 -0400 (AST) Received: from [10.0.1.82] (117-21-161-212.DSL.ONCOLT.COM [212.161.21.117]) by smtp.uk.colt.net (Postfix) with ESMTP id 3297312B573 for ; Tue, 21 Feb 2006 09:51:27 +0000 (GMT) From: David Goodenough To: pgsql-jdbc@postgresql.org Subject: Re: setString and timestamps Date: Tue, 21 Feb 2006 09:55:45 +0000 User-Agent: KMail/1.9.1 References: <200602171607.18071.david.goodenough@btconnect.com> <200602201431.55800.david.goodenough@btconnect.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200602210955.45502.david.goodenough@btconnect.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=1.559 required=5 tests=[AWL=-0.360, DNS_FROM_RFC_ABUSE=0.479, DNS_FROM_RFC_POST=1.44] X-Spam-Score: 1.559 X-Spam-Level: * X-Archive-Number: 200602/158 X-Sequence-Number: 14755 On Monday 20 February 2006 17:42, Kris Jurka wrote: > On Mon, 20 Feb 2006, David Goodenough wrote: > > What is the best way of finding the column types in generic code. That > > is to say if I have a method with no knowledge of a specific table and I > > am about to do an insert and I wish to get the parameters in the correct > > format what APIs exist that allow me to find out the type of a named > > column. I have looked through the JDBC docs without success so far, but > > it may be that I am looking for the wrong thing. If I need to use a > > Postgresql only API that is fine. > > DatabaseMetaData.getColumns or PreparedStatement.getParameterMetaData are > probably what you're looking for. > > Kris Jurka PreparedStatement.getParameterMetaData was the one I wanted. My copy of Java Enterprise in a Nutshell is too old, I must get a new one. Thank you David