From: "Mark G" <markag@wonderstats.com>
Subject: Re: obtain column names in oracle via jdbc
Date: 2000/08/08
Message-ID: <F4155D9F9AA4D111B9990020AFBA52D53E3CEF@class06.ip061.sfi-software.com>#1/1
References: <8mnc45$oto$1@nnrp1.deja.com>
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
X-MSMail-Priority: Normal
Reply-To: "Mark G" <markag@wonderstats.com>
Newsgroups: comp.databases.oracle.server,comp.databases.oracle,comp.databases.oracle.misc


Try doing

SELECT COLUMN_NAME
FROM USER_TAB_COLUMNS
WHERE TABLE_NAME = 'xyz';


<a7244270@my-deja.com> wrote in message news:8mnc45$oto$1@nnrp1.deja.com...
> Hi,
>
> I am trying to find out what the columns in a given table are.
>
> For some reason, the Oracle jdbc driver keeps telling me
>
> > Exception java.sql.SQLException: ORA-00900: invalid SQL statement
>
> which is obviously not true.
>
> Does anyone out there have any clue how can I do this ?
>
> Alfonso.
>
>
>
>
>
> java.sql.Connection connection = pool.get();
> ResultSet rs = null;
> connection = pool.get();
>
> Statement stmt = connection.createStatement();
>
>
> String command = "describe xyz";
> rs = stmt.executeQuery( command );
> if ( rs.next() )
> {
>     System.out.println("Col #1: " + rs.getString(1));
> }
> pool.release(connection);
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.




