JDBC Proxy

datasqill provides a JDBC proxy that can be used freely.

The proxy can be placed between a Java application and any 3rd party JDBC driver. Use cases for such a proxy include measuring runtimes, logging JDBC calls, or standardizing the behavior of JDBC drivers and encapsulating specific peculiarities of these drivers.

Special features:

The proxy driver returns a DsProxyClob implementation instead of a regular CLOB.

If you do not use DsProxy methods when working with the CLOB (but native methods instead), you can get the native CLOB via getPhysicalClob.

Connection Pooling

The following Java system properties can be set:

de.datasqill.dsproxy.pool.maxOpenConnections default 30 : maximum 30 open connections at the same time de.datasqill.dsproxy.pool.maxConnectionAgeInMinutes default 60 : 1 hour de.datasqill.dsproxy.pool.maxWaitForConnectionInMillis default -1 : wait forever de.datasqill.dsproxy.printSQL false : set to true if every executed SQL statement should be printed to stdout

Debugging

printOpenObjectsOnClose

if you set this in the datasqill connection string

dboptionlist={printOpenObjectsOnClose=summary}

then the number of not closed database objects per object type is written to the log.

Snowflake

Snowflake has some properties that can be passed through. The following are required especially for authentication:

  • user=
  • warehouse=
  • db=
  • schema=
  • authenticator=SNOWFLAKE_JWT
  • private_key_file=
  • loginTimeout=10
  • disablePlatformDetection=true

The following additional connection parameters can be set:

  • bulkTempDir: where temporary files are stored (default is /tmp)
  • bulkStageDir: where files are uploaded in Snowflake (default is @stage.stage)
  • printOpenObjectsOnClose: if true, all parsed SQL statements are printed to the console
  • printTimings: if true, timestamps are printed at different points

They are specified in the last block of the keyfile entry before the password:

SQTS_DB_XX jdbc:dsproxy:snowflake://<host>/?useArrowResultFormat=false||dboptionlist={user=datasqill,warehouse=<WH>,db=<Database>,schema=<Schema>,authenticator=SNOWFLAKE_JWT,private_key_file=<PATH OF Public Key>,loginTimeout=10,disablePlatformDetection=true,printOpenObjectsOnClose=summary,bulkTempDir=/tmp,bulkStageDir=@stage.migration,printTimings=true}|