Class Converter (0.19.1)

public class Converter implements AutoCloseable

Utility class for converting between generic PostgreSQL conversions.

Inheritance

java.lang.Object > Converter

Implements

AutoCloseable

Static 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.

Parameters
NameDescription
resultcom.google.cloud.spanner.ResultSet

The ResultSet to read the data from.

positionint

The column index.

formatProxyServer.DataFormat

The DataFormat format to use to encode the data.

sessionStateSessionState
Returns
TypeDescription
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)
Parameters
NameDescription
statementIntermediateStatement
modeConnectionHandler.QueryMode
optionsOptionsMetadata
resultSetcom.google.cloud.spanner.ResultSet
includeBinaryCopyHeaderInFirstRowboolean

Methods

close()

public void close()
Exceptions
TypeDescription
Exception

convertResultSetRowToDataRowResponse()

public int convertResultSetRowToDataRowResponse()
Returns
TypeDescription
int
Exceptions
TypeDescription
IOException

getResultSet()

public ResultSet getResultSet()
Returns
TypeDescription
com.google.cloud.spanner.ResultSet

includeBinaryCopyHeader()

public Converter includeBinaryCopyHeader()
Returns
TypeDescription
Converter

isIncludeBinaryCopyHeaderInFirstRow()

public boolean isIncludeBinaryCopyHeaderInFirstRow()
Returns
TypeDescription
boolean

writeBuffer(DataOutputStream outputStream)

public void writeBuffer(DataOutputStream outputStream)
Parameter
NameDescription
outputStreamDataOutputStream
Exceptions
TypeDescription
IOException