Search in sources :

Example 6 with Value

use of org.adbcj.Value in project adbcj by mheath.

the class DefaultRow method entrySet.

@Override
public Set<java.util.Map.Entry<Object, Value>> entrySet() {
    if (entrySet == null) {
        Set<java.util.Map.Entry<Object, Value>> set = new HashSet<Entry<Object, Value>>();
        for (Value value : values) {
            set.add(new AbstractMap.SimpleEntry<Object, Value>(value.getField(), value));
        }
        entrySet = Collections.unmodifiableSet(set);
    }
    return entrySet;
}
Also used : AbstractMap(java.util.AbstractMap) Value(org.adbcj.Value) HashSet(java.util.HashSet)

Example 7 with Value

use of org.adbcj.Value in project adbcj by mheath.

the class DefaultRow method get.

@Override
public Value get(Object key) {
    Field field = resultSet.getField(key);
    Value value = values[field.getIndex()];
    return value;
}
Also used : Field(org.adbcj.Field) Value(org.adbcj.Value)

Example 8 with Value

use of org.adbcj.Value in project adbcj by mheath.

the class ProtocolHandler method handleResultSetRowResponse.

private void handleResultSetRowResponse(AbstractMySqlConnection connection, ResultSetRowResponse message) {
    Request<ResultSet> activeRequest = connection.getActiveRequest();
    ResultSetRowResponse rowResponse = (ResultSetRowResponse) message;
    activeRequest.getEventHandler().startRow(activeRequest.getAccumulator());
    for (Value value : rowResponse.getValues()) {
        activeRequest.getEventHandler().value(value, activeRequest.getAccumulator());
    }
    activeRequest.getEventHandler().endRow(activeRequest.getAccumulator());
}
Also used : ResultSet(org.adbcj.ResultSet) Value(org.adbcj.Value)

Aggregations

Value (org.adbcj.Value)8 ResultSet (org.adbcj.ResultSet)3 Connection (org.adbcj.Connection)2 Result (org.adbcj.Result)2 DefaultValue (org.adbcj.support.DefaultValue)2 IOException (java.io.IOException)1 Charset (java.nio.charset.Charset)1 AbstractMap (java.util.AbstractMap)1 HashSet (java.util.HashSet)1 Field (org.adbcj.Field)1 PgField (org.adbcj.postgresql.codec.PgField)1 AbstractDbSession (org.adbcj.support.AbstractDbSession)1