You can use connection properties to customize the driver for your environment. This section lists the connection properties supported by the driver and describes each property. You can use these connection properties with either the JDBC DriverManager or a JDBC DataSource. For a DriverManager connection, a property is expressed as a key value pair and takes the form property=value. For a data source connection, a property is expressed as a JDBC method and takes the form setproperty(value).

Note:
  • In a JDBC data source, string values must be enclosed in double quotation marks, for example, setAuthenticationMethod("oauth2").
  • The data type listed for each connection property is the Java data type used for the property value in a JDBC data source.
  • Connection property names are case-insensitive. For example, AuthenticationMethod is the same as authenticationmethod.
  • For connection properties that support string values, use the following escape sequence to specify values containing leading or trailing spaces and curly brackets: {value}. For example: Project={myproject } or Project={{myproject}}.

The following tables provide a summary of the connection properties supported by the driver, their corresponding data source methods, and their default values.

Required properties

The following table summarizes connection properties that are required to connect to a Google BigQuery instance when the default authentication method, OAuth 2.0, is used for authentication.

Table 1. Required properties
Property Data Source Method Default
AccessToken setAccessToken None
AuthenticationMethod setAuthenticationMethod oauth2
ClientID setClientID None
ClientSecret setClientSecret None
Dataset setDataset None
Project setProject None
RefreshToken setRefreshToken None

Mapping properties

The following table summarizes connection properties involved in mapping the remote Google BigQuery data model to a local schema map used to support SQL queries against Google BigQuery.

Table 2. Mapping properties
Property Data Source Method Default
ConfigOptions setConfigOptions VarcharLength=65535; SchemaSet=;
CreateMap setCreateMap notExist
SchemaMap setSchemaMap Default value depends on environment

OAuth 2.0 properties

The following table summarizes connection properties that are used for OAuth 2.0 authentication.

Table 3. OAuth 2.0 properties
Property Data Source Method Default
AccessToken setAccessToken None
AuthenticationMethod setAuthenticationMethod oauth2
AuthURI setAuthUri https://accounts.google.com /o/oauth2/auth
ClientID setClientID None
ClientSecret setClientSecret None
EnableLoginPrompt setEnableLoginPrompt false
RedirectURI setRedirUri None
RefreshToken setRefreshToken None
Scope setScope https://www.googleapis.com/ auth/bigquery
TokenURI setTokenUri https://accounts.google.com /o/oauth2/token

Service account properties

The following table summarizes connection properties that are used for service account authentication.

Table 4. Service account properties
Property Data Source Method Default
AuthenticationMethod setAuthenticationMethod oauth2
JWTAudience setJwtAudience https://accounts.google.com /o/oauth2/token
ServiceAccountEmail setServiceAccountEmail None
ServiceAccountKeyContent setServiceAccountKeyContent None
ServiceAccountPrivateKey setServiceAccountPrivateKey None
TokenURI setTokenUri https://accounts.google.com /o/oauth2/token

Storage API properties

The following table summarizes connection properties that are used to leverage the Google BigQuery Storage API when fetching large result sets.

Property Data Source Method Default
StorageAPIMinPageCount setStorageAPIMinPageCount 3
StorageAPIThreshold setStorageAPIThreshold 10000
UseStorageAPI setUseStorageAPI false

Legacy SQL properties

The following table summarizes connection properties that can be used to execute queries using legacy SQL.

Table 5. Legacy SQL properties
Property Data Source Method Default
AllowLargeResults setAllowLargeResults false
LegacyDataset setLegacyDataset _queries_
LegacyTable setLegacytable _sql_*
Syntax setSyntax standard

Failover properties

The following table summarizes connection properties that can be used to implement failover.

Table 6. Failover properties
Property Data Source Method Default
ConnectionRetryCount setConnectionRetryCount 5
ConnectionRetryDelay setConnectionRetryDelay 1 (second)

Proxy server properties

The following table summarizes proxy server connection properties.

Table 7. Proxy Server properties
Property Data Source Method Default
ProxyHost setProxyHost None
ProxyPassword setProxyPassword None
ProxyPort setProxyPort 0
ProxyUser setProxyUser None

Web Service properties

The following table summarizes Web service connection properties, including those related to timeouts.

Table 8. Web Service properties
Property Data Source Method Default
WSFetchSize setWSFetchSize 10000
WSPoolSize setWSPoolSize 1
WSRetryCount setWSRetryCount 5
WSTimeout setWSTimeout 120 (seconds)

Timeout properties

The following table summarizes timeout connection properties.

Table 9. Timeout properties
Property Data Source Method Default
JobTimeout setJobTimeout 0 (no timeout)
LoginTimeout setLoginTimeout 0
WSRetryCount setWSRetryCount 5
WSTimeout setWSTimeout 120 (seconds)

Statement pooling properties

The following table summarizes statement pooling connection properties.

Table 10. Statement pooling properties
Property Data Source Method Default
ImportStatementPool setImportStatementPool None
MaxPooledStatements setMaxPooledStatements 0
RegisterStatementPoolMonitorMBean setRegisterStatementPoolMonitorMBean false

Additional properties

The following table summarizes additional connection properties.

Table 11. Additional properties
Property Data Source Method Default
BinaryLength setBinaryLength 65535
ConvertNull setConvertNull 1
EnableCatalogSupport setEnableCatalogSupport false
FetchSize setFetchSize 100 (rows)
JavaDoubleToString setJavaDoubleToString false
JsonFormat setJsonFormat raw
Location setLocation None
LogConfigFile setLogConfigFile ddlogging.properties
MaximumBytesBilled setMaximumBytesBilled 0 (no limit)
MaximumBillingTier setMaximumBillingTier 0
PrimaryKeyPattern setPrimaryKeyPattern *
RefreshSchema setRefreshSchema true
RefreshSchemaForDDL setRefreshSchemaForDDL true
RetryExceptions setRetryExceptions false
ServerName setServerName www.googleapis.com
SpyAttributes setSpyAttributes None
UseStreamingInsert useStreamingInsert true
UseQueryCache setUseQueryCache 1