3
votes

We are trying to connect a ColdFusion Engine to Google Bigquery.

Solaris / Linux OS
CFML Engine: ColdFusion or Lucee

We have tried the Simba JDBC Drivers provided by Google but the connection does not work, using a service account. OAuth is not something that is viable in that case.

Was wondering if anyone has tried the Java Class files to instantiate a connection and query a dataset in BigQuery.

Just looking for a Starting point in terms of setting up the connection and a basic query.

If someone got the Simba Driver working and have an example of the connection I am game for that too.

https://cloud.google.com/bigquery/partners/simba-drivers/

1
but the connection does not work - is very vague. What error is being reported?Miguel-F
Miguel, I assume you are asking about the simba driver, in CF and Lucee the driver is supposed to make a browser based call to get the access Privilege which the Datasource pages in Both engines do not support. Did not mean to be vague about it.user3263743
Looks like someone has used cfobject to run queries and insert rows using the java interface but the auth is hidden in a cfinclude. stackoverflow.com/questions/23892239/…user3263743

1 Answers

1
votes

I found this page which seems to have the steps laid out nicely for using their driver - Query BigQuery Data in ColdFusion

Write standard ColdFusion data access code to connect to BigQuery data.

The CData JDBC Driver for BigQuery seamlessly integrates connectivity to BigQuery data with the rapid development tools in ColdFusion. This article shows how to connect to BigQuery data in ColdFusion and query BigQuery tables.

Create a JDBC Data Source for BigQuery in ColdFusion

The JDBC data source enables you to execute SQL from standard ColdFusion tags like cfquery and CFScript like executeQuery.

  1. Copy the driver JAR and .lic file from the installation directory onto the ColdFusion classpath. For example, copy the files into C:\MyColdFusionDirectory\cfusion\wwwroot\WEB-INF\lib. Or, open the Java and JVM page in the ColdFusion Administrator and enter the path to the files in the ColdFusion Class Path box.

The JAR and license for the driver are located in the lib subfolder of the installation directory.

Restart the server after this step.

  1. Add the driver as a data source:

From the ColdFusion administrator interface, expand the Data & Services node and click Data Sources. In the Add New Data Source section, enter a name for the data source and select Other in the Driver menu.

  1. Populate the driver properties:

    • JDBC URL: Enter connection properties in the JDBC URL. The JDBC URL begins with jdbc:googlebigquery: and is followed by the connection properties in a semicolon-separated list of name=value pairs. A typical JDBC URL is below:

jdbc:googlebigquery:DataSetId=MyDataSetId;ProjectId=MyProjectId;InitiateOAuth=GETANDREFRESH

Google uses the OAuth authentication standard. To access Google APIs on behalf on individual users, you can use the embedded credentials or you can register your own OAuth app.

OAuth also enables you to use a service account to connect on behalf of users in a Google Apps domain. To authenticate with a service account, you will need to register an application to obtain the OAuth JWT values.

In addition to the OAuth values, you will need to specify the DatasetId and ProjectId. See the "Getting Started" chapter of the help documentation for a guide to using OAuth.

  • Driver Class: Enter the driver class. The driver class is cdata.jdbc.googlebigquery.GoogleBigQueryDriver.
    Driver Name: Enter a user-defined name for the driver.
    Username: Enter the username used to authenticate.
    Password: Enter the password used to authenticate.

  • Driver Name: Enter a user-defined name for the driver.

  • Username: Enter the username used to authenticate.

  • Password: Enter the password used to authenticate.

You can now test the connection by enabling the CData BigQuery data source in the Actions column. After reporting a status of OK, the BigQuery data source is ready for use.