use of nl.topicus.jdbc.CloudSpannerDataType in project spanner-jdbc by olavloite.
the class CloudSpannerResultSet method getArray.
@Override
public Array getArray(int columnIndex) throws SQLException {
if (isNull(columnIndex))
return null;
Type type = resultSet.getColumnType(columnIndex - 1);
if (type.getCode() != Code.ARRAY)
throw new CloudSpannerSQLException("Column with index " + columnIndex + " does not contain an array", com.google.rpc.Code.INVALID_ARGUMENT);
CloudSpannerDataType dataType = CloudSpannerDataType.getType(type.getArrayElementType().getCode());
List<? extends Object> elements = dataType.getArrayElements(resultSet, columnIndex - 1);
return CloudSpannerArray.createArray(dataType, elements);
}
Aggregations