Class CopyStatement (0.6.1)

publicclass CopyStatementextendsIntermediatePortalStatement

CopyStatement models a COPY table FROM STDIN statement. The same class is used both as an IntermediatePreparedStatement and IntermediatePortalStatement, as COPY does not support any statement parameters, which means that there is no difference between the two.

Inherited Members

Constructors

CopyStatement(ConnectionHandler connectionHandler, OptionsMetadata options, String name, AbstractStatementParser.ParsedStatement parsedStatement, Statement originalStatement)

publicCopyStatement(ConnectionHandlerconnectionHandler,OptionsMetadataoptions,Stringname,AbstractStatementParser.ParsedStatementparsedStatement,StatementoriginalStatement)
Parameters
Name Description
connectionHandler ConnectionHandler
options OptionsMetadata
name String
parsedStatement ParsedStatement
originalStatement com.google.cloud.spanner.Statement

Methods

bind(String name, byte[][] parameters, List<Short> parameterFormatCodes, List<Short> resultFormatCodes)

publicIntermediatePortalStatementbind(Stringname,byte[][]parameters,List<Short>parameterFormatCodes,List<Short>resultFormatCodes)

Bind this statement (that is to say, transform it into a portal by giving it the data items to complete the statement.

Parameters
Name Description
name String
parameters byte[][]
parameterFormatCodes List<Short>
resultFormatCodes List<Short>
Returns
Type Description
Overrides

close()

publicvoidclose()

Cleanly close the statement. Does nothing if the statement has not been executed or has no result.

Overrides Exceptions
Type Description

executeAsync(BackendConnection backendConnection)

publicvoidexecuteAsync(BackendConnectionbackendConnection)
Parameter
Name Description
backendConnection BackendConnection
Overrides

getCopyColumnNames()

publicList<String>getCopyColumnNames()
Returns
Type Description
List<String>

List of column names specified in COPY statement, if provided.

getDelimiterChar()

publicchargetDelimiterChar()
Returns
Type Description
char

Delimiter character specified in COPY statement, if provided.

getEscapeChar()

publicchargetEscapeChar()
Returns
Type Description
char

Escape character specified in COPY statement, if provided.

getException()

publicSpannerExceptiongetException()

Returns any execution exception registered for this statement.

Returns
Type Description
com.google.cloud.spanner.SpannerException
Overrides

getFormatCode()

publicintgetFormatCode()
Returns
Type Description
int

0 for text/csv formatting and 1 for binary

getFormatType()

publicStringgetFormatType()
Returns
Type Description
String

Format type specified in COPY statement, if provided.

getMutationWriter()

publicMutationWritergetMutationWriter()
Returns
Type Description

getNullString()

publicStringgetNullString()
Returns
Type Description
String

Null string specified in COPY statement, if provided.

getParserFormat()

publicCSVFormatgetParserFormat()
Returns
Type Description
org.apache.commons.csv.CSVFormat

getQuoteChar()

publicchargetQuoteChar()
Returns
Type Description
char

Quote character specified in COPY statement, if provided.

getStatementType()

publicAbstractStatementParser.StatementTypegetStatementType()
Returns
Type Description
Overrides

getTableColumns()

publicMap<String,Type>getTableColumns()
Returns
Type Description
Map<String,com.google.cloud.spanner.Type>

Mapping of table column names to column type.

getTableName()

publicStringgetTableName()
Returns
Type Description

getUpdateCount()

publiclonggetUpdateCount()
Returns
Type Description
Overrides

hasException()

publicbooleanhasException()
Returns
Type Description
Overrides

hasHeader()

publicbooleanhasHeader()
Returns
Type Description
boolean

True if copy data contains a header, false otherwise.

setParserFormat(CopyTreeParser.CopyOptions options)

publicvoidsetParserFormat(CopyTreeParser.CopyOptionsoptions)

CSVFormat for parsing copy data based on COPY statement options specified.

Parameter
Name Description

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年10月30日 UTC.