Topic: 请教:怎样得到数据库的字段名成到指定的数组里面

  Print this page

1.请教:怎样得到数据库的字段名成到指定的数组里面 Copy to clipboard
Posted by: gis_st
Posted on: 2004-12-14 16:12

数据库已经连接好
得到result
然后要得到数据库中的字段名成,怎么办呢?
刚开始学习,请指教。谢谢

2.Re:请教:怎样得到数据库的字段名成到指定的数组里面 [Re: gis_st] Copy to clipboard
Posted by: wes109
Posted on: 2004-12-15 01:24


ResultSet rs = stmt.executeQuery("SELECT a, b, c FROM TABLE2");
ResultSetMetaData rsmd = rs.getMetaData();
int numberOfColumns = rsmd.getColumnCount();
String columnsName = rsmd.getColumnName();


enjoy Big Smile

3.Re:请教:怎样得到数据库的字段名成到指定的数组里面 [Re: gis_st] Copy to clipboard
Posted by: gis_st
Posted on: 2004-12-15 08:34

thanks a lot

4.Re:请教:怎样得到数据库的字段名成到指定的数组里面 [Re: gis_st] Copy to clipboard
Posted by: ecsoftcn
Posted on: 2004-12-15 10:42

ResultSet rs = stmt.executeQuery("SELECT a, b, c FROM TABLE2");
ResultSetMetaData rsmd = rs.getMetaData();
int numberOfColumns = rsmd.getColumnCount();
String columnsName = rsmd.getColumnLabel(int);

我也是初学,如果不对的话请谅解


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923