![]() |
Sponsored Link •
|
Advertisement
|
Advertisement
|
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:
I changed () to [] and it gives another error: "Type mismatch: cannot convert from java.util.Hashtable[] to java.util.Hashtable". The array type error (which I posted in my first message) was at this line in the code: records[value] = new Hashtable(); Thank you for your help. Naveen
> 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
|