PreparedStatement pstm = connection.prepareStatement("select id from test where name=?");
pstm.setString(1,name1);
rset=pstm.executeQuery();
ResultSetMetaData rsmd = rset.getMetaData();
count=rsmd.getColumnCount(); //获得列数;
rsmd.getColumnName(i)获得该列列名
for(i=0;i<count;i++)
System.out.println(rsmd.getColumnName(i)+" | ");
int columnWidth = meta.getColumnDisplaySize(i);
String columnName=rsmd.getColumnName(i);
Label l = new Label(columnName);
TextField tf = new TextField(columnWidth);