public class Converter implements AutoCloseable
Utility class for converting between generic PostgreSQL conversions.
Implements
AutoCloseableStatic Methods
convertToPG(ResultSet result, int position, ProxyServer.DataFormat format, SessionState sessionState)
public static byte[] convertToPG(ResultSet result, int position, ProxyServer.DataFormat format, SessionState sessionState)
Return the data of the specified column of the ResultSet as a byte array. The column may not contain a null value.
Name | Description |
result |
com.google.cloud.spanner.ResultSet The ResultSet to read the data from. |
position |
int The column index. |
format |
ProxyServer.DataFormat The DataFormat format to use to encode the data. |
sessionState |
SessionState |
Type | Description |
byte[] |
a byte array containing the data in the specified format. |
Constructors
Converter(IntermediateStatement statement, ConnectionHandler.QueryMode mode, OptionsMetadata options, ResultSet resultSet, boolean includeBinaryCopyHeaderInFirstRow)
public Converter(IntermediateStatement statement, ConnectionHandler.QueryMode mode, OptionsMetadata options, ResultSet resultSet, boolean includeBinaryCopyHeaderInFirstRow)
Name | Description |
statement |
IntermediateStatement |
mode |
ConnectionHandler.QueryMode |
options |
OptionsMetadata |
resultSet |
com.google.cloud.spanner.ResultSet |
includeBinaryCopyHeaderInFirstRow |
boolean |
Methods
close()
public void close()
Type | Description |
Exception |
convertResultSetRowToDataRowResponse()
public int convertResultSetRowToDataRowResponse()
Type | Description |
int |
Type | Description |
IOException |
getResultSet()
public ResultSet getResultSet()
Type | Description |
com.google.cloud.spanner.ResultSet |
includeBinaryCopyHeader()
public Converter includeBinaryCopyHeader()
Type | Description |
Converter |
isIncludeBinaryCopyHeaderInFirstRow()
public boolean isIncludeBinaryCopyHeaderInFirstRow()
Type | Description |
boolean |
writeBuffer(DataOutputStream outputStream)
public void writeBuffer(DataOutputStream outputStream)
Name | Description |
outputStream |
DataOutputStream |
Type | Description |
IOException |