Using Oracle Database as the query store for the HTTP JSON API

I am testing the use of Oracle Database as the query store for the HTTP JSON API with the following config,

  server {
    address = "localhost"
    port = 7575
  ledger-api {
    address = "localhost"
    port = 5011
  query-store {
    base-config {
        user = "SYS"
        password = "Password1"
        driver = "oracle.jdbc.OracleDriver"
        url = "jdbc:oracle:thin:@//localhost:5432/"

        // prefix for table names to avoid collisions, empty by default
        table-prefix = "foo"

        // max pool size for the database connection pool
        pool-size = 12
        //specifies the min idle connections for database connection pool.
        min-idle = 4
        //specifies the idle timeout for the database connection pool.
        idle-timeout = 12s
        //specifies the connection timeout for database connection pool.
        connection-timeout = 90s
    // option setting how the schema should be handled.
    // Valid options are start-only, create-only, create-if-needed-and-start and create-and-start
    start-mode = "create-if-needed-and-start"

When I started the JSON API with this config using daml json-api -c myconfig.conf, I got the following error:

2023-07-19 05:34:43.103 [] ERROR com.daml.http.Main - Cannot start server, context: {instance_uuid: "c8cca4eb-5026-402f-86c7-cf4d7bfdca85"}
java.lang.RuntimeException: Failed to get driver instance for jdbcUrl=jdbc:oracle:thin:@localhost:5432/
	at com.zaxxer.hikari.util.DriverDataSource.<init>(
	at com.zaxxer.hikari.pool.PoolBase.initializeDataSource(
	at com.zaxxer.hikari.pool.PoolBase.<init>(
	at com.zaxxer.hikari.pool.HikariPool.<init>(
	at com.zaxxer.hikari.HikariDataSource.<init>(
	at com.daml.dbutils.ConnectionPool$.dataSource(Connection.scala:69)
	at com.daml.dbutils.ConnectionPool$.connect(Connection.scala:45)
	at com.daml.http.dbbackend.ContractDao$.$anonfun$apply$4(ContractDao.scala:112)
	at com.daml.http.dbbackend.ContractDao$.$anonfun$apply$2(ContractDao.scala:106)
	at scala.util.Either.flatMap(Either.scala:352)
	at com.daml.http.dbbackend.ContractDao$.apply(ContractDao.scala:101)
	at com.daml.http.Main$.$anonfun$main$5(Main.scala:120)
	at com.daml.http.Main$.$anonfun$main$4(Main.scala:120)
	at scala.concurrent.impl.Promise$
	at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:63)
	at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:100)
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
	at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:94)
	at akka.dispatch.BatchingExecutor$
	at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:48)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(
	at java.base/java.util.concurrent.ForkJoinPool.scan(
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(
	at java.base/
Caused by: java.sql.SQLException: No suitable driver
	at java.sql/java.sql.DriverManager.getDriver(
	at com.zaxxer.hikari.util.DriverDataSource.<init>(
	... 27 common frames omitted

Where can I configure the location of this driver?

1 Like

Hi @rexng,

Your configuration looks correct. Which version of the JSON API server are you using? Is it by any chance the community edition?

Kind Regards,

1 Like

Hi @Mate_Varga, apologies you are right. It works fine when I switched to use the enterprise edition of the HTTP JSON API server.

1 Like