Passing the connection URL
After setting the CLASSPATH, the required connection information needs to be passed in the form of a connection URL. The connection URL takes the form:
Connection URL Syntax
jdbc:datadirect:googlebigquery:Project=project ;Dataset=dataset ;
AccessToken=accesstoken ;RefreshToken=refreshtoken ;ClientID=clientid ;
ClientSecret=clientsecret [;property=value [;...]]
where:
Project
specifies the name of the project that you want the driver to connect to. The projects in Google BigQuery are equivalent to catalogs in JDBC.
Dataset
specifies the name of the dataset that you want the driver to connect to. The datasets in Google BigQuery are equivalent to schemas in JDBC.
AccessToken
specifies the access token required to authenticate to a Google BigQuery instance.
RefreshToken
specifies the refresh token used to either request a new access token or renew an expired access token.
ClientID
specifies the consumer key for your application.
ClientSecret
specifies the consumer secret for your application.
Connection URL Example
Connection conn = DriverManager.getConnection
("jdbc:datadirect:googlebigquery:Project=myproject;Dataset=mydataset;
AccessToken=abcdefghi12345678;RefreshToken=wxyz123456789;
ClientID=123abc.apps.googleusercontent.com;ClientSecret=ab123xy");