Class BigQueryDriver (2.58.0)

public class BigQueryDriver implements Driver

JDBC Driver implementation for BigQuery.

Usage:

String CONNECTION_URL = "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443"

  • "ProjectId=test;OAuthType=3"" Connection connection = DriverManager.getConnection(CONNECTION_URL);

Valid URLs take the form:

jdbc:bigquery://{host}:{port};ProjectId={projectId};OAuthType={oAuthType}; {property1}={value1};{property2}={value2};...

Inheritance

java.lang.Object > BigQueryDriver

Implements

Driver

Static Methods

getRegisteredDriver()

public static BigQueryDriver getRegisteredDriver()
Returns
Type Description
BigQueryDriver

the registered JDBC driver for BigQuery.

Exceptions
Type Description
IllegalStateException

if the driver has not been registered.

Constructors

BigQueryDriver()

public BigQueryDriver()

Methods

acceptsURL(String url)

public boolean acceptsURL(String url)

See Also: Driver#acceptsURL(String)

Parameter
Name Description
url String

a JDBC connection URL

Returns
Type Description
boolean

True if the URL is non-empty and starts with "jdbc:bigquery"

Exceptions
Type Description
SQLException

connect(String url, Properties info)

public Connection connect(String url, Properties info)

Attempts to establish a BigQuery connection to the given URL, using the provided connection Properties.

Valid URLs take the form:

jdbc:bigquery://{host}:{port};ProjectId={projectId};OAuthType={oAuthType}; {property1}={value1};{property2}={value2};...

See Also: Driver#connect(String, Properties)

Parameters
Name Description
url String

the BigQuery URL to connect to

info Properties

a list of arbitrary string tag/value pairs as connection arguments.

Returns
Type Description
Connection

A connection to the URL if it was established successfully, otherwise null

Exceptions
Type Description
SQLException

if driver fails to connect to clients.

getMajorVersion()

public int getMajorVersion()
Returns
Type Description
int

getMinorVersion()

public int getMinorVersion()
Returns
Type Description
int

getParentLogger()

public Logger getParentLogger()
Returns
Type Description
Logger

getPropertyInfo(String url, Properties info)

public DriverPropertyInfo[] getPropertyInfo(String url, Properties info)

Gets information about the possible BigQuery JDBC Connection Properties. See Also: Driver#getPropertyInfo(String, Properties)

Parameters
Name Description
url String

the BigQuery connection URL

info Properties

a proposed list BigQuery connection properties

Returns
Type Description
java.sql.DriverPropertyInfo[]

an array of DriverPropertyInfo objects describing possible properties.

jdbcCompliant()

public boolean jdbcCompliant()
Returns
Type Description
boolean