Send feedback
Class BigQueryStatement (2.58.0)
Stay organized with collections
Save and categorize content based on your preferences.
Version latestkeyboard_arrow_down
public class BigQueryStatement extends BigQueryNoOpsStatement
Inheritance
Object >
com.google.cloud.bigquery.jdbc.BigQueryNoOpsStatement >
BigQueryStatement
Inherited Members
com.google.cloud.bigquery.jdbc.BigQueryNoOpsStatement.<T>unwrap(java.lang.Class<T>)
com.google.cloud.bigquery.jdbc.BigQueryNoOpsStatement.execute(java.lang.String,int)
com.google.cloud.bigquery.jdbc.BigQueryNoOpsStatement.execute(java.lang.String,int[])
com.google.cloud.bigquery.jdbc.BigQueryNoOpsStatement.execute(java.lang.String,java.lang.String[])
com.google.cloud.bigquery.jdbc.BigQueryNoOpsStatement.executeUpdate(java.lang.String,int)
com.google.cloud.bigquery.jdbc.BigQueryNoOpsStatement.executeUpdate(java.lang.String,int[])
com.google.cloud.bigquery.jdbc.BigQueryNoOpsStatement.executeUpdate(java.lang.String,java.lang.String[])
com.google.cloud.bigquery.jdbc.BigQueryNoOpsStatement.getGeneratedKeys()
com.google.cloud.bigquery.jdbc.BigQueryNoOpsStatement.isWrapperFor(java.lang.Class<?>)
com.google.cloud.bigquery.jdbc.BigQueryNoOpsStatement.setCursorName(java.lang.String)
Static Fields
queryTaskExecutor
protected static ExecutorService queryTaskExecutor
Constructors
BigQueryStatement(BigQueryConnection connection)
public BigQueryStatement ( BigQueryConnection connection )
Fields
batchQueries
protected List<String> batchQueries
cancelLock
protected Object cancelLock
Field Value
Type
Description
Object
closeOnCompletion
protected boolean closeOnCompletion
Field Value
Type
Description
boolean
connection
protected BigQueryConnection connection
currentJobIdIndex
protected int currentJobIdIndex
Field Value
Type
Description
int
currentResultSet
protected ResultSet currentResultSet
currentUpdateCount
protected long currentUpdateCount
Field Value
Type
Description
long
isCanceled
protected boolean isCanceled
Field Value
Type
Description
boolean
isClosed
protected boolean isClosed
Field Value
Type
Description
boolean
jobIds
protected List<JobId> jobIds
maxFieldSize
protected int maxFieldSize
Field Value
Type
Description
int
maxRows
Field Value
Type
Description
int
parentJobId
protected BigQueryStatement . JobIdWrapper parentJobId
Field Value
Type
Description
com.google.cloud.bigquery.jdbc.BigQueryStatement.JobIdWrapper
poolable
protected boolean poolable
Field Value
Type
Description
boolean
queryTimeout
protected int queryTimeout
Field Value
Type
Description
int
warning
protected SQLWarning warning
Methods
<T>unwrap(Class<T> iface)
public T <T>unwrap ( Class<T> iface )
Parameter
Name
Description
iface
Class <T >
Returns
Type
Description
T
Overrides
com.google.cloud.bigquery.jdbc.BigQueryNoOpsStatement.<T>unwrap(java.lang.Class<T>)
addBatch(String sql)
public void addBatch ( String sql )
Parameter
Name
Description
sql
String
cancel()
Cancels this Statement object, the running threads, and BigQuery jobs.
Exceptions
Type
Description
SQLException
if a BigQuery access error occurs or this method is called on a closed
Statement
clearBatch()
clearWarnings()
public void clearWarnings ()
close()
Releases this Statement's BigQuery and JDBC resources immediately instead of waiting for this
to happen when it is automatically closed. These resources include the ResultSet
object, batch queries, job IDs, and BigQuery connection
Calling the method close on a Statement object that is already closed has no effect.
Exceptions
Type
Description
SQLException
if a BigQuery access error occurs
closeOnCompletion()
public void closeOnCompletion ()
execute(String sql)
public boolean execute ( String sql )
Parameter
Name
Description
sql
String
executeBatch()
public int [] executeBatch ()
Returns
Type
Description
int []
executeLargeUpdate(String sql)
public long executeLargeUpdate ( String sql )
Parameter
Name
Description
sql
String
Returns
Type
Description
long
executeQuery(String sql)
public ResultSet executeQuery ( String sql )
This method executes a BigQuery SQL query, return a single ResultSet object.
Example of running a query:
Connection connection = DriverManager.getConnection(CONNECTION_URL);
Statement bigQueryStatement = bigQueryConnection.createStatement();
ResultSet result = bigQueryStatement.executeQuery(QUERY);
See Also: java.sql.Statement#executeQuery(String)
Parameter
Name
Description
sql
String BigQuery SQL query
Returns
Type
Description
ResultSet
ResultSet containing the output of the query
Exceptions
Type
Description
SQLException
if a BigQuery access error occurs, this method is called on a closed
Statement, the given SQL statement produces multiple or no result sets.
executeUpdate(String sql)
public int executeUpdate ( String sql )
Parameter
Name
Description
sql
String
Returns
Type
Description
int
getConnection()
public Connection getConnection ()
public Map<String , String > getExtraLabels ()
Gets the extra labels for this statement.
getFetchDirection()
public int getFetchDirection ()
Returns
Type
Description
int
getFetchSize()
public int getFetchSize ()
Returns
Type
Description
int
getLargeUpdateCount()
public long getLargeUpdateCount ()
Returns
Type
Description
long
getMaxFieldSize()
public int getMaxFieldSize ()
Returns
Type
Description
int
getMaxRows()
Returns
Type
Description
int
getMoreResults()
public boolean getMoreResults ()
getMoreResults(int current)
public boolean getMoreResults ( int current )
Parameter
Name
Description
current
int
getQueryTimeout()
public int getQueryTimeout ()
Returns
Type
Description
int
getResultSet()
public ResultSet getResultSet ()
getResultSetConcurrency()
public int getResultSetConcurrency ()
Returns
Type
Description
int
getResultSetHoldability()
public int getResultSetHoldability ()
Returns
Type
Description
int
getResultSetType()
public int getResultSetType ()
Returns
Type
Description
int
getUpdateCount()
public int getUpdateCount ()
Returns
Type
Description
int
getWarnings()
public SQLWarning getWarnings ()
hasMoreResults()
public boolean hasMoreResults ()
isCloseOnCompletion()
public boolean isCloseOnCompletion ()
isClosed()
public boolean isClosed ()
isPoolable()
public boolean isPoolable ()
isWrapperFor(Class<?> iface)
public boolean isWrapperFor ( Class <? > iface )
Parameter
Name
Description
iface
Class <? >
Overrides
com.google.cloud.bigquery.jdbc.BigQueryNoOpsStatement.isWrapperFor(java.lang.Class<?>)
logQueryExecutionStart(String sql)
protected void logQueryExecutionStart ( String sql )
Parameter
Name
Description
sql
String
setEscapeProcessing(boolean enable)
public void setEscapeProcessing ( boolean enable )
Parameter
Name
Description
enable
boolean
public void setExtraLabels ( Map<String , String > extraLabels )
Sets the extra labels for this statement.
Parameter
Name
Description
extraLabels
Map <String ,String >A map of the extra labels.
setFetchDirection(int direction)
public void setFetchDirection ( int direction )
Parameter
Name
Description
direction
int
setFetchSize(int rows)
public void setFetchSize ( int rows )
Parameter
Name
Description
rows
int
setMaxFieldSize(int max)
public void setMaxFieldSize ( int max )
Parameter
Name
Description
max
int
setMaxRows(int max)
public void setMaxRows ( int max )
Parameter
Name
Description
max
int
setPoolable(boolean poolable)
public void setPoolable ( boolean poolable )
Parameter
Name
Description
poolable
boolean
setQueryTimeout(int seconds)
public void setQueryTimeout ( int seconds )
Parameter
Name
Description
seconds
int
Send feedback
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 2026-02-02 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-02-02 UTC."],[],[]]