SQL JDBC driver API
You can make Druid SQL queries using the . We recommend using Avatica JDBC driver version 1.17.0 or later. Note that as of the time of this writing, Avatica 1.17.0, the latest version, does not support passing connection string parameters from the URL to Druid, so you must pass them using a object. Once you’ve downloaded the Avatica client jar, add it to your classpath and use the connect string .
Example code:
The protobuf endpoint is also known to work with the official Golang Avatica driver
Table metadata is available over JDBC using or by querying the .
Note that the non-JDBC API is stateless and does not require stickiness.
Dynamic parameters
You can use in JDBC code, as in this example: