How to use the Firebolt JDBC driver
<version>3.3.0</version>
with the latest version available in the Firebolt Maven Central repository.3.3.0
with the latest version available in the Firebolt Maven Central repository.<database>
- Specifies the name of the Firebolt database to connect to.
<connection_params>
- A list of connection parameters formatted as a standard URL query string.
client_id
and a client_secret
for identification.
To ensure compatibility with tools external to Firebolt, you can specify the service account’s client_id
as user
and client_secret
as password
.
The following are examples of how to specify connection strings for authentication and configuration:
Example
The following example connection string configures the Firebolt JDBC driver to connect to my_database
using a specified client_id
and secret_id
for authentication:
my_account
, an engine name my_engine
, a buffer size of 1000000
bytes, and a connection timeout of 10000
milliseconds, or 10
seconds.
Example
The following example provides client_id
and client_secret
as separate properties, rather than embedding them directly in the connection string, as shown in the previous example.
Connection string:
my_database
using only connection properties for authentication and parameters, without including any parameters directly in the string.
Connection string:
my_database
using client_id
and client_secret
as connection properties for authentication, omitting the engine name and therefore connects to default engine and relying on default values for all other parameters:
Connection string:
my_database
connects to the default engine.
Parameter key | Data type | Default value | Range | Description |
---|---|---|---|---|
client_id | TEXT | No default value. | (Required) The Firebolt service account ID. | |
client_secret | TEXT | No default value. | (Required) The secret generated for the Firebolt service account. | |
account | TEXT | No default value. | (Required) Your Firebolt account name. | |
database | TEXT | No default value. | The name of the database to connect to. Takes precedence over the database name provided as a path parameter. | |
engine | TEXT | The default engine attached to the specified database. | The name of the engine to connect to. | |
buffer_size | INTEGER | 65536 | 1 to 2147483647 | The buffer size, in bytes, that the driver uses to read the responses from the Firebolt API. |
connection_timeout_millis | INTEGER | 60000 | 0 to 2147483647 | The wait time in milliseconds before a connection to the server is considered failed. A timeout value of zero means that the connection will wait indefinitely. |
max_connections_total | INTEGER | 300 | 1 to 2147483647 | The maximum total number of connections. |
socket_timeout_millis | INTEGER | 0 | 0 to 2147483647 | The socket timeout, in milliseconds, which specifies the maximum wait time for data, defining the longest allowed inactivity between consecutive data packets. A value of zero means that there is no timeout limit. |
connection_keep_alive_timeout_millis | INTEGER | 300000 | 1 to 2147483647 | Defines the duration to keep a server connection open in the connection pool before it is closed. |
ssl_mode | TEXT | strict | strict or none | When set to strict , the SSL or TLS certificate is validated for accuracy and authenticity. If set to none , certificate verification is omitted. |
ssl_certificate_path | TEXT | No default value. | The absolute file path for the SSL root certificate. | |
validate_on_system_engine | BOOLEAN | FALSE | TRUE or FALSE | When set to TRUE , the connection is always validated against a system engine, even if it’s connected to a regular engine. For more information, see Connection validation. |
cache_connection | BOOLEAN | TRUE | TRUE or FALSE | Keep this enabled for better performance when interacting with Firebolt. If you experience connection issues that might be related to stale cache set this to FALSE. Available only with JDBC driver version 3.6.1 and above. |
SET
command. Multiple SET
statements can be run consecutively, separated by semicolons, as shown below:
SELECT 1
query to the system engine. If this query fails, the driver throws an exception. You can use the validate_on_system_engine
parameter to customize validation. When it is set to true
, the validation query is sent to the system engine, even if the connection is established with a regular engine. This feature can be useful if you want to stop the regular engine but still need to validate the connection.
The following example configures the Firebolt JDBC driver to connect to my_database
and validate the connection using the system engine with additional connection parameters specified in other_connection_parameters
: