com.github.housepower.jdbc.protocol.DataRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of clickhouse-native-jdbc Show documentation
Show all versions of clickhouse-native-jdbc Show documentation
ClickHouse Native Protocol JDBC implementation
package com.github.housepower.jdbc.protocol;
import com.github.housepower.jdbc.data.Block;
import com.github.housepower.jdbc.serializer.BinarySerializer;
import java.io.IOException;
import java.sql.SQLException;
public class DataRequest extends RequestOrResponse {
public static final DataRequest EMPTY = new DataRequest("");
private final String name;
private final Block block;
public DataRequest(String name) {
this(name, new Block());
}
public DataRequest(String name, Block block) {
super(ProtocolType.REQUEST_DATA);
this.name = name;
this.block = block;
}
@Override
public void writeImpl(BinarySerializer serializer) throws IOException, SQLException {
serializer.writeStringBinary(name);
serializer.maybeEnableCompressed();
block.writeTo(serializer);
serializer.maybeDisenableCompressed();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy