当前位置: 技术问答>java相关
怎样能取得数据库表中列的类型?
来源: 互联网 发布时间:2015-03-11
本文导语: 为了取得列的数据类型,作下面的一段程序: Connection con=···; Statement ps = con.createStatement(); ResultSet rs = ps.executeQuery("select * from testTable order by ID"); ResultSetMetaData md=rs.getMetaData(); int i=1; while(i
为了取得列的数据类型,作下面的一段程序:
Connection con=···;
Statement ps = con.createStatement();
ResultSet rs = ps.executeQuery("select * from testTable order by ID");
ResultSetMetaData md=rs.getMetaData();
int i=1;
while(i
Connection con=···;
Statement ps = con.createStatement();
ResultSet rs = ps.executeQuery("select * from testTable order by ID");
ResultSetMetaData md=rs.getMetaData();
int i=1;
while(i