当前位置: 技术问答>java相关
java里有没有办法得到一个表里的字段名
来源: 互联网 发布时间:2015-08-01
本文导语: 如题 | Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery(sql); ResultSetMetaData rsmd = rs.getMetaData(); int columnCount = rsmd.getColumnCount(); String[] columnName = new String[columnCount]; for (int i = ...
如题
|
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(sql);
ResultSetMetaData rsmd = rs.getMetaData();
int columnCount = rsmd.getColumnCount();
String[] columnName = new String[columnCount];
for (int i = 0; i
ResultSet rs = stmt.executeQuery(sql);
ResultSetMetaData rsmd = rs.getMetaData();
int columnCount = rsmd.getColumnCount();
String[] columnName = new String[columnCount];
for (int i = 0; i