2020
10-09
10-09
java中ResultSet遍历数据操作
1.查找数据库中表的列名<prename="code"class="html">Stringsql="select*fromtblmetadatainfo";ResultSetrs=MySqlHelper.executeQuery(sql,null);Stringstr="";try{ResultSetMetaDatarsmd=rs.getMetaData();for(inti=1;i<rsmd.getColumnCount();i++){str+=rsmd.getColumnName(i)+",";}str=str.substring(0,str.length()-1);}catch(SQLExceptione){//TODOAuto-generatedcatchblo...
继续阅读 >