public List<Warehouse> getWarehouseByBranch(int branchid)
	{
		List<Warehouse> warehouses = new ArrayList<Warehouse>();
        Connection con = null;
        Statement stmt = null;
        try {
            DBconnection dbCon = new DBconnection();
            Class.forName(dbCon.getJDBC_DRIVER());

            con = DriverManager.getConnection(dbCon.getDATABASE_URL(),
                    dbCon.getDB_USERNAME(), dbCon.getDB_PASSWORD());
            stmt = con.createStatement();
            
            String query="Select wrh_id,wrh_quantity,wrh_salerentprice,wrh_minlimit,wrh_maxlimit,wrh_isavailable,wrh_isactive,item_id,branch_id "
                    +"From warehouse where  branch_id="+branchid;
            
            ResultSet rs = stmt.executeQuery(query);
            
            
            while (rs.next()) {
            	Warehouse warehouse=new Warehouse();
          	  warehouse=new Warehouse();
           	  warehouse.setId(rs.getLong(1));
           	  warehouse.setQuantity(rs.getInt(2));
           	  warehouse.setSaleRentPrice(rs.getDouble(3));
           	  warehouse.setMinLimit(rs.getInt(4));
           	  warehouse.setMaxLimit(rs.getInt(5));
           	  warehouse.setIsAvailable(rs.getBoolean(6));
           	  warehouse.setIsActive(rs.getBoolean(7));          	  
           	  warehouse.setItem(rs.getInt(8));
          	  warehouse.setBranch(rs.getInt(9));        	  
          	  
          	  warehouses.add(warehouse);
            }
        } catch (SQLException | ClassNotFoundException ex) {
            System.err.println("Caught Exception: " + ex.getMessage());
        } finally {
            try {
                if (stmt != null) {
                    stmt.close();
                }
                if (con != null) {
                    con.close();
                }
            } catch (SQLException ex) {
                System.err.println("Caught Exception: " + ex.getMessage());
            }
        }
        return warehouses;
		
	}