From: Schlough, Mark <Mark.Schlough@nmb.norwest.com>
To: Peter T Mount <pmount@maidast.demon.co.uk>
To: petermount@earthling.net
To: pgsql-interfaces@postgresql.org
Subject: More JDBC questions in PG6.3
Date: Wed, 11 Mar 1998 10:12:00 -0600
Message-ID: <3506baa40f29002@m0e3s11.nmb.norwest.com> (raw)
Does anyone have an example of how this feature works? I'm
still reasonably new to JDBC and I want to get this working
properly. I'm at a loss of how to implement the driver
differently than I already have. Any and all help is
appreciated.
Basically I am trying to get the ResultSetMetaData to work.
(See the code snippet below)
[Please CC your reply to mtschlou@cloudnet.com]
Thanks
Mark
______________________________ Reply Separator
_________________________________
Subject: Re: More JDBC questions in 6.3
Author: Peter T Mount [SMTP:pmount@maidast.demon.co.uk] at NMB
Date: 3/6/98 3:48 PM
On Fri, 6 Mar 1998, Schlough, Mark wrote:
> ---------my other questions----------------
>
> I am using the book "JDBC Database Access with Java" and
after > using
> some of the examples, (available for download from
> http://www.javasoft.com/products/jdbc/book.html) I run
> into problems.
> I'm wondering if these methods are supported by the
> driver:
> The questions so far seem to deal with ResultSetMetaData
>
> I am having trouble getting it to return the datatypes,
> such as VARCHAR, INTEGER, FLOAT,....
>
> code snip ----- 8-< ----
>
> ResultSetMetaData rsmd
>
> int columns = rsmd.getColumnCount();
> for (int i = 1; i<= columns; i++) {
>
> int jdbcType = rsmd.getColumnType(i)
> String name = rsmd.getColumnTypeName(i)
> System.out.print("Column "+1+" is JDBC type " + jdbcType);
> System.out.print(", which the DBMS calls " + name);
> }
>
> code snip ----- 8-< ----
>
> the code runs, but I get results like:
>
> Column 1 is JDBC type 12. which the DBMS calls null
> Column 2 is JDBC type 4. which the DBMS calls null
> Column 3 is JDBC type 8. which the DBMS calls null
> Column 4 is JDBC type 4. which the DBMS calls null
>
> does anyone know if these ResultSetMetaData methods that
> look at the datatypes are supposed to work, or are they not
> implemented?
> If they are supposed to work, could someone help me figure out
what
> I am missing.
>
> Thanks in advance
>
> Mark
I'll check the current source to make sure nothing is broken, but this
is supported (and has been for quite some time)
If you have some sample code to test this please let me know, If there
is code in the release that I am too blind to see then let me know too
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-interfaces@postgresql.org
Cc: Mark.Schlough@nmb.norwest.com, pmount@maidast.demon.co.uk, petermount@earthling.net
Subject: Re: More JDBC questions in PG6.3
In-Reply-To: <3506baa40f29002@m0e3s11.nmb.norwest.com>
References: <3506baa40f29002@m0e3s11.nmb.norwest.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