Code example for Statement

Methods: close, executeUpdate

0
			Connection conn = ConnectionPool.getConnection();
			Statement stmt = conn.createStatement();
			StaffInfo staffInfo = (StaffInfo)infoBean;
			 
			String sql = "update LogInfo set userPassWord= '"+newPwd+"' where staffID="+staffInfo.getStaffID();
			result = stmt.executeUpdate(sql);
			stmt.close();
			conn.close();
		} catch (SQLException e) {
			e.printStackTrace();
		} 
	} 
	 
	private int result = 0;
	 
	@Override 
	public void process(Info infoBean) {
		// TODO Auto-generated method stub 
		 
	} 
}