当前位置: 技术问答>java相关
请问如何获得结果集的列数?
来源: 互联网 发布时间:2015-06-17
本文导语: 如题 | ResultSet rs = ......; ResultSetMetaData rsmd = rs.getMetaData(); int columnCount = rsmd.getColumnCount(); | protected ResultSet rs = null; . . . ResultSetMetaData rsmd = rs.getMetaData(); int columnCo...
如题
|
ResultSet rs = ......;
ResultSetMetaData rsmd = rs.getMetaData();
int columnCount = rsmd.getColumnCount();
ResultSetMetaData rsmd = rs.getMetaData();
int columnCount = rsmd.getColumnCount();
|
protected ResultSet rs = null;
.
.
.
ResultSetMetaData rsmd = rs.getMetaData();
int columnCount = rsmd.getColumnCount();
String cName=rsmd.getColumnName(int column) ;
.
.
.
ResultSetMetaData rsmd = rs.getMetaData();
int columnCount = rsmd.getColumnCount();
String cName=rsmd.getColumnName(int column) ;