use of com.google.cloud.spanner.pgadapter.wireoutput.NoDataResponse in project pgadapter by GoogleCloudPlatform.
the class DescribeMessage method handleDescribeStatement.
/**
* Called when a describe message of type 'S' is received.
*
* @throws Exception if sending the message back to the client causes an error.
*/
public void handleDescribeStatement() throws Exception {
try {
DescribeStatementMetadata metadata = (DescribeStatementMetadata) this.statement.describe();
new ParameterDescriptionResponse(this.outputStream, metadata.getParameters()).send();
if (metadata.getResultSet() != null) {
new RowDescriptionResponse(this.outputStream, this.statement, metadata.getResultSet(), this.connection.getServer().getOptions(), QueryMode.EXTENDED).send();
} else {
new NoDataResponse(this.outputStream).send();
}
} catch (SpannerException exception) {
this.handleError(exception);
}
}
Aggregations