NB5 Docs► Reference Section► Drivers▼ JDBC driver 🖺

JDBC driver

This JDBC driver leverages Hikari Connection Pool for connection pool and works with PostgreSQL®. This leverages NoSQLBench based workload generation and performance testing against any PostgreSQL-compatible database cluster. Example: CockroachDB® or YugabyteDB® (YSQL API).

Executing JDBC Workload

The following is an example of invoking a JDBC workload.

<nb_cmd> run driver=jdbc workload="/path/to/workload.yaml" cycles=1000 threads=100 url="jdbc:postgresql://" serverName=localhost portNumber=5432 databaseName=defaultdb ... -vv --show-stacktraces

In the above NB command, following are JDBC driver specific parameters:

Other NB engine parameters are straight forward:

Configuration

These are the main configurations with which we could issue a query and process the results back based on the PostgreSQL® Query pattern.

Config Sources

Statement Forms

The syntax for specifying these types is simplified as well, using only a single type field which allows values of execute, query, & update and specifying the raw statements in the stmt. Alternatively, one could directly use one of the types and provide the raw query directly.

Examples

Check out the default activities under the activities.baselinesv2 directory.

Op Template Examples

ops:
  drop-database:
    type: execute
    stmt: |
      DROP DATABASE IF EXISTS TEMPLATE(database,baselines);
  create-table:
    execute: |
      CREATE TABLE IF NOT EXISTS TEMPLATE(database,baselines).TEMPLATE(table,keyvalue);
  select-table:
    query: |
      SELECT one, two, three FROM TEMPLATE(database,baselines).TEMPLATE(table,keyvalue) WHERE ...;
  insert-table:
    update: |
      UPDATE TABLE TEMPLATE(database,baselines).TEMPLATE(table,keyvalue) SET key = 'value' WHERE ...;

Back to top