Hi,

Below is my code where I am trying to access ignite cache using JDBC API. I
am getting exception as mentioned after my code -

try {
                        Class.forName("org.apache.ignite.IgniteJdbcDriver");
                        try (Connection conn = DriverManager.getConnection(
                                
"jdbc:ignite:cfg://file:///Users/Documents/workspace-sts/spring-boot-test/src/main/resources/mpm-ignite.xml"))
{
                                Ignition.setClientMode(true);
                                 rs = 
conn.createStatement().executeQuery("select * from A");
                                 List<Map&lt;String, Object>> list = 
IgniteJdbcApi.resultSetToList(rs);
                                 System.out.println(">>> list   : " + list);
                                 rs.close();
                        }
                } catch (ClassNotFoundException e) {
                        e.printStackTrace();
                } catch (SQLException e) {
                        e.printStackTrace();
                }

Exception:
-------------
20:51:27.467 [main] DEBUG
org.springframework.beans.factory.support.DefaultListableBeanFactory -
Returning cached instance of singleton bean 'ignite.cfg$child#0'
[20:51:27]    __________  ________________ 
[20:51:27]   /  _/ ___/ |/ /  _/_  __/ __/ 
[20:51:27]  _/ // (7 7    // /  / / / _/   
[20:51:27] /___/\___/_/|_/___/ /_/ /___/  
[20:51:27] 
[20:51:27] ver. 1.7.0#20160801-sha1:383273e3
[20:51:27] 2016 Copyright(C) Apache Software Foundation
[20:51:27] 
[20:51:27] Ignite documentation: http://ignite.apache.org
[20:51:27] 
[20:51:27] Quiet mode.
[20:51:27]   ^-- To see **FULL** console log here add -DIGNITE_QUIET=false
or "-v" to ignite.{sh|bat}
[20:51:27] 
[20:51:27] OS: Mac OS X 10.11.6 x86_64
[20:51:27] VM information: Java(TM) SE Runtime Environment 1.8.0_71-b15
Oracle Corporation Java HotSpot(TM) 64-Bit Server VM 25.71-b15
[20:51:27] Initial heap size is 256MB (should be no less than 512MB, use
-Xms512m -Xmx512m).
[20:51:27] Configured plugins:
[20:51:27]   ^-- None
[20:51:27] 
[20:51:28] Security status [authentication=off, tls/ssl=on]
[20:51:29] To start Console Management & Monitoring run
ignitevisorcmd.{sh|bat}
[20:51:29] 
[20:51:29] Ignite node started OK (id=41d9710a,
grid=ignite-jdbc-driver-8aee265e-44dd-42d7-b7ad-52f5af2303ba)
[20:51:29] Topology snapshot [ver=6, servers=1, clients=1, CPUs=8,
heap=7.1GB]
[20:51:29] Eviction policy not enabled with ONHEAP_TIERED mode for cache
(entries will not be moved to off-heap store): salesCache
[20:51:29] Ignite node stopped OK
[name=ignite-jdbc-driver-8aee265e-44dd-42d7-b7ad-52f5af2303ba,
uptime=00:00:00:144]
Exception in thread "main" java.lang.AbstractMethodError:
org.apache.ignite.internal.processors.query.h2.opt.GridH2Table$ScanIndex.getCost(Lorg/h2/engine/Session;[I[Lorg/h2/table/TableFilter;ILorg/h2/result/SortOrder;Ljava/util/HashSet;)D
        at org.h2.table.TableFilter.getBestPlanItem(TableFilter.java:203)
        at org.h2.table.Plan.calculateCost(Plan.java:123)
        at org.h2.command.dml.Optimizer.testPlan(Optimizer.java:183)
        at org.h2.command.dml.Optimizer.calculateBestPlan(Optimizer.java:79)
        at org.h2.command.dml.Optimizer.optimize(Optimizer.java:242)
        at org.h2.command.dml.Select.preparePlan(Select.java:1014)
        at org.h2.command.dml.Select.prepare(Select.java:878)
        at org.h2.command.Parser.prepareCommand(Parser.java:259)
        at org.h2.engine.Session.prepareLocal(Session.java:560)
        at org.h2.engine.Session.prepareCommand(Session.java:501)
        at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1202)
        at 
org.h2.jdbc.JdbcPreparedStatement.<init>(JdbcPreparedStatement.java:73)
        at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:290)
        at
org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.prepareStatement(IgniteH2Indexing.java:406)
        at
org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.queryTwoStep(IgniteH2Indexing.java:1121)
        at
org.apache.ignite.internal.processors.query.GridQueryProcessor$2.applyx(GridQueryProcessor.java:732)
        at
org.apache.ignite.internal.processors.query.GridQueryProcessor$2.applyx(GridQueryProcessor.java:730)
        at
org.apache.ignite.internal.util.lang.IgniteOutClosureX.apply(IgniteOutClosureX.java:36)
        at
org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuery(GridQueryProcessor.java:1666)
        at
org.apache.ignite.internal.processors.query.GridQueryProcessor.queryTwoStep(GridQueryProcessor.java:730)
        at
org.apache.ignite.internal.processors.cache.IgniteCacheProxy.query(IgniteCacheProxy.java:700)
        at
org.apache.ignite.internal.jdbc2.JdbcQueryTask.call(JdbcQueryTask.java:158)
        at
org.apache.ignite.internal.jdbc2.JdbcStatement.executeQuery(JdbcStatement.java:102)
        at com.boot.IgniteJdbcApi.main(IgniteJdbcApi.java:49)




--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Exception-while-trying-to-access-cache-via-JDBC-API-tp8648.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Reply via email to