当前位置: 技术问答>java相关
如何返回数据库中表的结构?
来源: 互联网 发布时间:2015-03-30
本文导语: Java中想获得数据库表的结构,该如何做? | rs = new resultSet(); java.sql.ResultSetMetaData rsmd = rs.getMetaData(); int columnCount = rsmd.getColumnCount(); String[] cols = new String[columnCount]; String[] coltype = new...
Java中想获得数据库表的结构,该如何做?
|
rs = new resultSet();
java.sql.ResultSetMetaData rsmd = rs.getMetaData();
int columnCount = rsmd.getColumnCount();
String[] cols = new String[columnCount];
String[] coltype = new String[columnCount];
for (int i = 0; i
java.sql.ResultSetMetaData rsmd = rs.getMetaData();
int columnCount = rsmd.getColumnCount();
String[] cols = new String[columnCount];
String[] coltype = new String[columnCount];
for (int i = 0; i