public static StoreResults newInstance()

in elastic-db-tools/src/main/java/com/microsoft/azure/elasticdb/shard/sqlstore/SqlResults.java [68:134]


    public static StoreResults newInstance(CallableStatement cstmt) {
        StoreResults storeResults = new StoreResults();
        try {
            do {
                ResultSet rs = cstmt.getResultSet();
                if (rs == null) {
                    return storeResults;
                }
                if (!rs.next()) { // move to first row.
                    continue;
                }
                SqlResultType resultType = resultFromColumnName.get(rs.getMetaData().getColumnLabel(2));
                switch (resultType) {
                    case ShardMap:
                        do {
                            storeResults.getStoreShardMaps().add(readShardMap(rs, 2));
                        }
                        while (rs.next());
                        break;
                    case Shard:
                        do {
                            storeResults.getStoreShards().add(readShard(rs, 2));
                        }
                        while (rs.next());
                        break;
                    case ShardMapping:
                        do {
                            storeResults.getStoreMappings().add(readMapping(rs, 2));
                        }
                        while (rs.next());
                        break;
                    case ShardLocation:
                        do {
                            storeResults.getStoreLocations().add(readLocation(rs, 2));
                        }
                        while (rs.next());
                        break;
                    case SchemaInfo:
                        do {
                            storeResults.getStoreSchemaInfoCollection().add(readSchemaInfo(rs, 2));
                        }
                        while (rs.next());
                        break;
                    case StoreVersion:
                        do {
                            storeResults.setStoreVersion(readVersion(rs, 2));
                        }
                        while (rs.next());
                        break;
                    case Operation:
                        do {
                            storeResults.getLogEntries().add(readLogEntry(rs, 2));
                        }
                        while (rs.next());
                        break;
                    default:
                        break;
                }
            }
            while (cstmt.getMoreResults());

        }
        catch (SQLException e) {
            e.printStackTrace();
        }
        return storeResults;
    }