日期:2014-05-20 浏览次数:20734 次
string str=null; String sql = ("select salesmanname from order where orderID = '"+033+"'"); sta.executeQuery(sql) try { while(rs.next()) { str = rs.getString(1); } if(str != null) { isname = true; //如果为空 返回true,反之返回false return; } else { isname = false Strin sql = ("update order set salesmanname ='"+NewName+"' where orderID = '"+033+"'"); sta.executeQuery(sql); } } catch (Exception e) { e.printStackTrace(); }