日期:2014-05-16 浏览次数:20491 次
?
public void getMetaDataName(String tbname){ try { ResultSet rs = Connect.getConnection().createStatement().executeQuery("select * from "+tbname); ResultSetMetaData rss = rs.getMetaData(); int columnCount = rss.getColumnCount(); System.out.println("Column's count : "+columnCount); for(int i = 1;i<=columnCount; i++){ System.out.println(rss.getColumnName(i)); } } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } }?