JDBC Client Driver
Reference for the GridGain JDBC Client Driver, which connects to the cluster through a client node, including supported parameters and streaming mode.
JDBC Client Driver interacts with the cluster by means of a client node.
JDBC Client Driver
The JDBC Client Driver connects to the cluster by using a client node connection. You must provide a complete Spring XML configuration as part of the JDBC connection string, and copy all the JAR files mentioned below to the classpath of your application or SQL tool:
All the JARs under
{GRIDGAIN_HOME}\libsdirectory.All the JARs under
{GRIDGAIN_HOME}\ignite-indexingand{GRIDGAIN_HOME}\ignite-springdirectories.
The driver itself is more robust, and might not support the latest SQL features of Ignite. However, because it uses the client node connection underneath, it can execute and distribute queries, and aggregate their results directly from the application side.
The JDBC connection URL has the following pattern:
jdbc:ignite:cfg://[<params>@]<config_url>Where:
<config_url>is required and must represent a valid URL that points to the configuration file for the client node. This node will be started within the Ignite JDBC Client Driver when it (the JDBC driver) tries to establish a connection with the cluster.<params>is optional and has the following format:
param1=value1:param2=value2:...:paramN=valueNThe name of the driver's class is org.apache.ignite.IgniteJdbcDriver. For example, here's how to open a JDBC connection to the Ignite cluster:
// Registering the JDBC driver.
Class.forName("org.apache.ignite.IgniteJdbcDriver");
// Opening JDBC connection (cache name is not specified, which means that we use default cache).
Connection conn = DriverManager.getConnection("jdbc:ignite:cfg://config/ignite-jdbc.xml");
Supported Parameters
cache
Cache name. Note that the cache name is case sensitive.
None.
nodeId
ID of node where query will be executed. Useful for querying through local caches.
None.
local
Query will be executed only on a local node. Use this parameter with the nodeId parameter in order to limit data set by specified node.
false
collocated
Flag that is used for optimization purposes. Whenever GridGain executes a distributed query, it sends subqueries to individual cluster members. If you know in advance that the elements of your query selection are colocated together on the same node, Ignite can make significant performance and network optimizations.
false
distributedJoins
Allows use of distributed joins for non-colocated data.
false
streaming
Turns on bulk data load mode via INSERT statements for this connection. Refer to the Streaming Mode section for more details.
false
streamingAllowOverwrite
Tells GridGain to overwrite values for existing keys on duplication instead of skipping them. Refer to the Streaming Mode section for more details.
false
streamingFlushFrequency
Timeout, in milliseconds, that data streamer should use to flush data. By default, the data is flushed on connection close. Refer to the Streaming Mode section for more details.
0
streamingPerNodeBufferSize
Data streamer's per node buffer size. Refer to the Streaming Mode section for more details.
1024
streamingPerNodeParallelOperations
Data streamer's per node parallel operations number. Refer to the Streaming Mode section for more details.
16
transactionsAllowed
Presently ACID Transactions are supported, but only at the key-value API level. At the SQL level, GridGain supports atomic, but not transactional consistency.
This means that the JDBC driver might throw a Transactions are not supported exception if you try to use this functionality.
However, in cases when you need transactional syntax to work (even without transactional semantics), e.g. some BI tools might force the transactional behavior, set this parameter to true to prevent exceptions from being thrown.
false
multipleStatementsAllowed
JDBC driver will be able to process multiple SQL statements at a time, returning multiple ResultSet objects. If the parameter is disabled, the query with multiple statements fails.
false
lazy
Lazy query execution.
With lazy=false, GridGain fetches the entire query result set to memory and sends it upstream. For small and medium result sets, this provides optimal performance and minimizes duration of internal database locks, thus increasing concurrency.
With lazy=true (by default), query result sets are processed in a streaming manner, and are sent upstream page-by-page, thus minimizing memory consumption at the cost of moderate performance reduction. This is the preferred option for large result sets because, if a result set does not fit in the available memory, the processing leads to excessive GC pauses and Out of Memory (OOM) errors.
• SELECT * FROM Table or SELECT col1, col2 FROM Table - the data is fetched page-by-page, which precludes OOM.
• SELECT * FROM Table WHERE col>10 or SELECT col1, col2 FROM Table WHERE col>10 (any predicate as long as it's not a nested subquery) - the data is fetched page-by-page, which precludes OOM.
If the system does not have an index that corresponds to the query, lazy=true might not prevent OOM errors in the following cases:
• SELECT col1 FROM Table GROUP BY col1 - grouping without aggregation; lazy=true doesn't help if the aggregating node runs out of memory.
• SELECT col1, AVG(col2) FROM Table GROUP BY col1 - same as the previous case.
• SELECT DISTINCT(col1) or SELECT COUNT(DISTINCT(col1)) or SELECT DISTINCT(col1) ... LIMIT - the entire result set must be fetched. However, the data is retrieved page-by-page. Therefore, if the aggregating node is the same as the node containing the data, these two nodes share the available memory, so lazy=true will reduce memory utilization, thus reducing the probability of OOM errors.
• SELECT ... JOIN - same outcome as in the previous case.
• SELECT .. OFFSET/LIMIT ORDER BY - aggregates the entire result set on a node and passes on a chunk (page). Same result as in the previous case.
• Subqueries - the result depends on what a specific subquery is interpreted into. It is safe to assume that lazy=true brings no benefit (even if the system has an index that corresponds to the query).
true
skipReducerOnUpdate
Enables server side update feature.
When GridGain executes a DML operation, it first fetches all of the affected intermediate rows for analysis to the query initiator (also known as reducer), and then prepares batches of updated values to be sent to remote nodes.
This approach might impact performance and saturate the network if a DML operation has to move many entries over it.
Use this flag as a hint for GridGain to perform all intermediate rows analysis and updates "in-place" on the corresponding remote data nodes.
Defaults to false, meaning that intermediate results will be fetched to the query initiator first.
false
queryMaxMemory
Maximum amount of memory available to each query executed through the current connection. This parameter overrides the memory quota for queries.
none
Streaming Mode
It's feasible to add data into a cluster in streaming mode (bulk mode) using the JDBC driver. In this mode, the driver instantiates IgniteDataStreamer internally and feeds data to it. To activate this mode, add the streaming parameter set to true to a JDBC connection string:
Streaming mode is supported only for INSERT operations. This is useful in cases when you want to achieve fast data preloading into a cache. The JDBC driver defines multiple connection parameters that affect the behavior of the streaming mode. These parameters are listed in the parameters table above.
The parameters cover almost all of the settings of a general IgniteDataStreamer and allow you to tune the streamer according to your needs. Please refer to the Data Streaming section for more information on how to configure the streamer.
Example
To start processing the data located in the cluster, you need to create a JDBC Connection object using one of the methods below:
Right after that you can execute your SQL SELECT queries:
You can use DML statements to modify the data.
INSERT
MERGE
UPDATE
DELETE
This page is: Copyright © 2026 MariaDB. All rights reserved.
Last updated
Was this helpful?

