Java swing中,如何将在SQL server中查询到的字段赋值于页面文本框
1个回答
展开全部
sqlment=cont.createStatement();
String str="use easy;select RoomNo from Room where TypeCode='"+roomty+"'"+
" and RoomStatus1 in ('VC') order by RoomNo";
ResultSet rs=sqlment.executeQuery(str);
while(rs.next()){
text.setText(rs.getString(1).trim());
}
}
String str="use easy;select RoomNo from Room where TypeCode='"+roomty+"'"+
" and RoomStatus1 in ('VC') order by RoomNo";
ResultSet rs=sqlment.executeQuery(str);
while(rs.next()){
text.setText(rs.getString(1).trim());
}
}
更多追问追答
追问
那所添加到的界面的文本框,应怎样调用该方法呢
追答
String str=text.getText().trim();
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询