关于数据查找后赋值问题
程序段:
String sqlb= "select orderid from order where khno= ' "+khno+ " ' ";
ResultSet rsb=con.executeQuery(sqlb);
if(rsb.next()){
String orderid=rsb.getString(1);
rsb.close();}
请问为何第四行无法赋值(记录是肯定有的),而改用session.setAttribute( "orderid ",rsb.getString(1));则可以?是我写错了那里?谢谢!
[解决办法]
加个.toString()看看?