MicroStrategy ONE

Connect to Square Using JDBC

Connecting to Square using JDBC is only supported on MicroStrategy ONE Update 11 or earlier. If you are using MicroStrategy ONE Update 12 or later, see Connect to Square Using ODBC.

Square is a point of sale that takes care of digital receipts, inventory and sales reports, and provides valuable analytics and feedback. MicroStrategy ships the Square JDBC connector for customer to connect Square as data source when doing data import on Web and Workstation.

The Square JDBC driver supports standard SQL-92 syntax and functions but limited in write back and performance. MicroStrategy will support in-memory data import and choose to process data on our side.

  • Data Retrieve Mode: JDBC Call Only
  • Data Import supported: Select Tables, Free Form SQL, Query Builder (In-memory)

JDBC Connection URL

MicroStrategy ships the Square JDBC driver to connect Square as a data source with the following connection methods. You can find them on the data source dialog when importing data.

  • Using Access Token method

    jdbc:square://;HOST=[Host];PORT=[port];Auth_Type=OAuth 2.0;Auth_AccessToken=[Access_Token];

  • Using Standard Access method

    jdbc:square://;HOST=[Host];PORT=[port];Auth_Type=OAuth 2.0;Auth_AccessToken=[Access_Token]; Auth_Client_ID=[Client_ID]; Auth_Client_Secret=[Client_Secret];

See How to Get Credentials for Square for steps to acquire the correct parameters.

Square has a rate limit of 10 requests per second.

JDBC Schema Tables

The Square API operates at System and Location levels. Organization-wide information objects and operations are surfaced under the System schema. Data for individual locations are surfaced under their own schema, according to their Location nickname (defined in the Location table). When you create a new location, a corresponding location schema containing all location level tables will be created at the same time.

Users can only see the schema and tables that they have access to according to their login credentials.

Configure Square using JDBC on Web and Workstation

See Create and Edit Data Sources for steps to create a new data source and connection.

  1. Choose Add Data > New Data.
  2. Find the Square connector in the data source list.

  3. Click the connector.
  4. Choose Select Tables, Type a Query, or Build a Query to import data.

    It is recommended to use Select Tables to reduce joins on the driver side for best performance.

  5. In the Data Source interface, select DSN-less Data Source and choose Square for both Database and Version. Use one of the following methods to configure the DSN-less connection:
    • Access Token: Enter the required fields Host Name, Port Number, and Access Token.

      You should use https://connect.squareup.com as a host name when using an Access Token connection.

    • Standard Access: Enter the required fields Host Name, Port Number, Client ID, and Client Secret.

      You should use connect.squareup.com as a host name when using a Standard Access connection.

    • Edit the Connection String: Click Show connection string and select Edit connection string. Enter the connection information of the JDBC connection string.

      Ignore Driver. Type any character in the User and Password fields, as they will not be used in the connection.

  6. Click OK.
  7. Click on the new Data Source to connect.

In-Memory Data Import

  1. Click your Square data source and select the tables you want to import.

  2. Click Prepare Data.
  3. Click Finish.
  4. Select Import as an In-memory Dataset Mode to publish a cube.

How to Get Credentials for Square

Sign up for a Square account if you don't have an account.

  1. Log in to your Square account.
  2. Click Applications to open the Applications Dashboard.

  3. Create a Connect API application or choose an existing one.
  4. On the Credentials tab, you can find the Application ID and the Access Token for the connection string in MicroStrategy.

  5. The OAuth tab allows you to access the Application Secret for your MicroStrategy connection string.