The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
April 2001

Advertisement

Advertisement
where you can ask and answer Java programming questions.">
artima.com - a resource for Java and Jini developers
Artima | Search | Java | Design | JVM | Jini | Books | Seminars | Subscribe 


Java Answers Forum
April 2001

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Hashtable Problem

Posted by Naveen on May 01, 2001 at 8:53 PM

I am getting an error "The type of the expression [java.util.Hashtable] must be an array type. Could someone help me with this please?

Code:

/** * SelectComponent constructor comment. */ public SelectComponent(Connection c, String sql) throws SQLException {

try {

Statement stmt= c.createStatement();

ResultSet rs = stmt.executeQuery(sql);

ResultSetMetaData meta = rs.getMetaData();

meta.getColumnCount();

records = new Hashtable(meta.getColumnCount());

int row = 0;

while (rs.next()) {

row++;

records[value] = new Hashtable();

for (int i = 0; i < columnCount; i++) { records[i].put(row, rs.getString(i+value));

}

}

setRowCount(row);

} catch (Exception e) {

e.printStackTrace();

} }

Thank you,

Naveen




Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us