public static ResultSet getPlaces(Connection conn, Map<String, String> params) throws SQLException, InvalidParameterException {
        PreparedStatement sp = null;
        try {
            if (params.get(IDCLIENT) != null) {
                sp = conn.prepareStatement("exec dbo.Wga_GetPlaces ?, ?, ?, ?");
            } else {
                sp = conn.prepareStatement("exec Wga_GetPlacesNC ?, ?, ?");
            }
            if (params.get(IDPERFORMANCE) != null) {
                sp.setLong(1, Long.parseLong(params.get(IDPERFORMANCE)));
            }
            if ((params.get(WITHPRICE) != null) && !(params.get(WITHPRICE).equalsIgnoreCase("null"))) {
                sp.setShort(2, Short.parseShort(params.get(WITHPRICE)));
            } else {
                sp.setNull(2, java.sql.Types.SMALLINT);
            }
            if ((params.get(ALLPLACES) != null) && !(params.get(ALLPLACES).equalsIgnoreCase("null"))) {
                sp.setShort(3, Short.parseShort(params.get(ALLPLACES)));
            } else {
                sp.setNull(3, java.sql.Types.SMALLINT);
            }
            if (params.get(IDCLIENT) != null) {
                sp.setInt(4, Integer.parseInt(params.get(IDCLIENT)));
            }
            return sp.executeQuery();
        } finally {
            if (sp != null) {
                sp.close();
            }
        }
    }