Package org.apache.ignite
Class IgniteJdbcThinDriver
- java.lang.Object
- 
- org.apache.ignite.IgniteJdbcThinDriver
 
- 
- All Implemented Interfaces:
- Driver
 
 public class IgniteJdbcThinDriver extends Object implements Driver JDBC driver thin implementation for In-Memory Data Grid.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. LimitationsData in Ignite cache is usually distributed across several nodes, so some queries may not work as expected since the query will be sent to each individual node and results will then be collected and returned as JDBC result set. Keep in mind following limitations (not applied if data is queried from one node only, or data is fully co-located or fully replicated on multiple nodes):- 
         Joins will work correctly only if joined objects are stored in
         collocated mode. Refer to
         AffinityKeyjavadoc for more details.
- Note that if you are connected to local or replicated cache, all data will be queried only on one node, not depending on what caches participate in the query (some data from partitioned cache can be lost). And visa versa, if you are connected to partitioned cache, data from replicated caches will be duplicated.
 SQL NoticeDriver allows to query data from several caches. Cache that driver is connected to is treated as default schema in this case. Other caches can be referenced by their names.\DependenciesJDBC driver is located in main Ignite JAR inIGNITE_HOME/libsfolder.ConfigurationJDBC connection URL has the following pattern: jdbc:ignite:thin://<hostname>:<port>/
 Note the following:- Hostname is required.
- If port is not defined, 10800is used (default for Ignite thin client).
 Propertiesobject passed toDriverManager.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 Example// 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 SummaryConstructors Constructor Description IgniteJdbcThinDriver()
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanacceptsURL(String url)Connectionconnect(String url, Properties props)intgetMajorVersion()intgetMinorVersion()LoggergetParentLogger()DriverPropertyInfo[]getPropertyInfo(String url, Properties info)booleanjdbcCompliant()static Driverregister()
 
- 
- 
- 
Method Detail- 
connectpublic Connection connect(String url, Properties props) throws SQLException - Specified by:
- connectin interface- Driver
- Throws:
- SQLException
 
 - 
acceptsURLpublic boolean acceptsURL(String url) throws SQLException - Specified by:
- acceptsURLin interface- Driver
- Throws:
- SQLException
 
 - 
getPropertyInfopublic DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException - Specified by:
- getPropertyInfoin interface- Driver
- Throws:
- SQLException
 
 - 
getMajorVersionpublic int getMajorVersion() - Specified by:
- getMajorVersionin interface- Driver
 
 - 
getMinorVersionpublic int getMinorVersion() - Specified by:
- getMinorVersionin interface- Driver
 
 - 
jdbcCompliantpublic boolean jdbcCompliant() - Specified by:
- jdbcCompliantin interface- Driver
 
 - 
getParentLoggerpublic Logger getParentLogger() throws SQLFeatureNotSupportedException - Specified by:
- getParentLoggerin interface- Driver
- Throws:
- SQLFeatureNotSupportedException
 
 - 
registerpublic static Driver register() - Returns:
- Driver instance.
 
 
- 
 
-