日期:2014-05-20 浏览次数:20820 次
Connection c = DriverManager.getConnection("jdbc:odbc:Test"); Statement s = c.createStatement(); r = s.executeQuery("select * from "+tableName+";"); ResultSetMetaData rs = r.getMetaData(); for (int i = 1; i <= rs.getColumnCount(); i++) { columnName.add(new String(rs.getColumnLabel(i))); }