public class IgniteJdbcThinDriver extends Object implements Driver
Driver allows to get distributed data from Ignite cache using standard SQL queries and standard JDBC API. It will automatically get only fields that you actually need from objects stored in cache.
AffinityKey
javadoc for more details.
IGNITE_HOME/libs
folder.
JDBC connection URL has the following pattern:
jdbc:ignite://<hostname>:<port>/
Note the following:
10800
is used (default for Ignite thin client).Properties
object passed to
DriverManager.getConnection(String, Properties)
method:
Name | Description | Default | Optional |
---|---|---|---|
ignite.jdbc.distributedJoins | Flag to enable distributed joins. | false (distributed joins are disabled) |
Yes |
ignite.jdbc.enforceJoinOrder | Flag to enforce join order of tables in the query. | false (enforcing join order is disabled) |
Yes |
// Open JDBC connection. Connection conn = DriverManager.getConnection("jdbc:ignite:thin//localhost:10800"); // Query persons' names ResultSet rs = conn.createStatement().executeQuery("select name from Person"); while (rs.next()) { String name = rs.getString(1); ... } // Query persons with specific age PreparedStatement stmt = conn.prepareStatement("select name, age from Person where age = ?"); stmt.setInt(1, 30); ResultSet rs = stmt.executeQuery(); while (rs.next()) { String name = rs.getString("name"); int age = rs.getInt("age"); ... }
Constructor and Description |
---|
IgniteJdbcThinDriver() |
Modifier and Type | Method and Description |
---|---|
boolean |
acceptsURL(String url) |
Connection |
connect(String url,
Properties props) |
int |
getMajorVersion() |
int |
getMinorVersion() |
Logger |
getParentLogger() |
DriverPropertyInfo[] |
getPropertyInfo(String url,
Properties info) |
boolean |
jdbcCompliant() |
static Driver |
register() |
public Connection connect(String url, Properties props) throws SQLException
connect
in interface Driver
SQLException
public boolean acceptsURL(String url) throws SQLException
acceptsURL
in interface Driver
SQLException
public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException
getPropertyInfo
in interface Driver
SQLException
public int getMajorVersion()
getMajorVersion
in interface Driver
public int getMinorVersion()
getMinorVersion
in interface Driver
public boolean jdbcCompliant()
jdbcCompliant
in interface Driver
public Logger getParentLogger() throws SQLFeatureNotSupportedException
getParentLogger
in interface Driver
SQLFeatureNotSupportedException
public static Driver register()
GridGain In-Memory Computing Platform : ver. 8.9.14 Release Date : November 5 2024