Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Oracle Lite JDBC trouble getting column names

Oracle Lite JDBC trouble getting column names

From: Gerald B. Rosenberg <gbr_at_fdml.com>
Date: 1998/10/26
Message-ID: <MPG.109e5391c842010b989682@sanfrancisco01.news.internex.net>#1/1

I am having trouble retrieving the names of the columns of a table using JDBC. I am using Oracle Lite 3.0.624 and it's provided JDBC driver and executing under VC4Java 2.5a (jdk1.1.5 I think).

I am using almost the same code to fetch the Schema names and Table names without any apparent difficulty. However, when I go to get the column name using rset.getString(4), the application core dumps.

Can you see what the problem is? Is there a better way to code this?

Thanks,
Gerald

Code snippet:

...

        Vector vect = new Vector();
        String cname = "";
        s = schema;
        t = table;

...
ResultSet rset = dbMeta.getColumns(null, s, t, null); do { try { cname = new String(rset.getString(4)); // 4=column name } catch (SQLException ex) { System.err.println("Error getting column name\n" + ex); } if (cname.length() > 0) { vect.addElement(cname); System.err.println("Column: " + cname); } } while (rset.next()); rset.close(); return vect;
Received on Mon Oct 26 1998 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US