Thank you for your answer! I put the device table creation in a play framework 
‘evolution’:
# --- !Ups
CREATE TABLE device (
  id VARCHAR,
  secret VARCHAR,
  name VARCHAR,
  updated_at TIMESTAMP,
  created_at TIMESTAMP,
  PRIMARY KEY (id)
);

# --- !Downs
DROP TABLE device;
The ‘ups’ part should be run on startup.
The JDBC driver is configured like this in the application.conf of the play 
framework:

db.default.driver=org.apache.ignite.IgniteJdbcThinDriver
db.default.url="jdbc:ignite:thin://?.?.?.?"
Where I have replaced the ‘?' with actual numbers related to the external 
kubernetes IP address.

The logs from one of the kubernetes ignite nodes says this:
ignite-node <>  2018-02-16T00:40:38.517434195Z  ... 17 more
ignite-node <>  2018-02-16T00:40:38.517431019Z  at 
org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.queryDistributedSqlFields(IgniteH2Indexing.java:1365)
ignite-node <>  2018-02-16T00:40:38.517427905Z  at 
org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.prepareStatement(IgniteH2Indexing.java:402)
ignite-node <>  2018-02-16T00:40:38.517424810Z  at 
org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:288)
ignite-node <>  2018-02-16T00:40:38.517421498Z  at 
org.h2.jdbc.JdbcPreparedStatement.<init>(JdbcPreparedStatement.java:73)
ignite-node <>  2018-02-16T00:40:38.517418414Z  at 
org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1204)
ignite-node <>  2018-02-16T00:40:38.517415060Z  at 
org.h2.engine.Session.prepareCommand(Session.java:514)
ignite-node <>  2018-02-16T00:40:38.517402169Z  at 
org.h2.engine.Session.prepareLocal(Session.java:573)
ignite-node <>  2018-02-16T00:40:38.517399163Z  at 
org.h2.command.Parser.prepareCommand(Parser.java:257)
ignite-node <>  2018-02-16T00:40:38.517396219Z  at 
org.h2.command.Parser.parse(Parser.java:292)
ignite-node <>  2018-02-16T00:40:38.517393254Z  at 
org.h2.command.Parser.parse(Parser.java:320)
ignite-node <>  2018-02-16T00:40:38.517390293Z  at 
org.h2.command.Parser.parsePrepared(Parser.java:416)
ignite-node <>  2018-02-16T00:40:38.517387238Z  at 
org.h2.command.Parser.parseInsert(Parser.java:1056)
ignite-node <>  2018-02-16T00:40:38.517384274Z  at 
org.h2.command.Parser.readTableOrView(Parser.java:5483)
ignite-node <>  2018-02-16T00:40:38.517381319Z  at 
org.h2.command.Parser.readTableOrView(Parser.java:5506)
ignite-node <>  2018-02-16T00:40:38.517378364Z  at 
org.h2.message.DbException.get(DbException.java:155)
ignite-node <>  2018-02-16T00:40:38.517375329Z  at 
org.h2.message.DbException.get(DbException.java:179)
ignite-node <>  2018-02-16T00:40:38.517372275Z  at 
org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
ignite-node <>  2018-02-16T00:40:38.517369377Z  [42102-195]
ignite-node <>  2018-02-16T00:40:38.517366492Z  values (?, ?, ?, ?)
ignite-node <>  2018-02-16T00:40:38.517363527Z  insert into device(id, secret, 
updated_at, created_at)
ignite-node <>  2018-02-16T00:40:38.517360301Z  Caused by: 
org.h2.jdbc.JdbcSQLException: Table "DEVICE" not found; SQL statement:
ignite-node <>  2018-02-16T00:40:38.517357290Z  at 
java.lang.Thread.run(Thread.java:748)
ignite-node <>  2018-02-16T00:40:38.517354246Z  at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
ignite-node <>  2018-02-16T00:40:38.517351147Z  at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
ignite-node <>  2018-02-16T00:40:38.517347126Z  at 
org.apache.ignite.internal.util.worker.GridWorkerPool$1.run(GridWorkerPool.java:70)
ignite-node <>  2018-02-16T00:40:38.517324823Z  at 
org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110)
ignite-node <>  2018-02-16T00:40:38.517321429Z  at 
org.apache.ignite.internal.util.nio.GridNioAsyncNotifyFilter$3.body(GridNioAsyncNotifyFilter.java:97)
ignite-node <>  2018-02-16T00:40:38.517316840Z  at 
org.apache.ignite.internal.util.nio.GridNioFilterAdapter.proceedMessageReceived(GridNioFilterAdapter.java:109)
ignite-node <>  2018-02-16T00:40:38.517313572Z  at 
org.apache.ignite.internal.util.nio.GridNioFilterChain$TailFilter.onMessageReceived(GridNioFilterChain.java:279)
ignite-node <>  2018-02-16T00:40:38.517310241Z  at 
org.apache.ignite.internal.processors.odbc.ClientListenerNioListener.onMessage(ClientListenerNioListener.java:39)
ignite-node <>  2018-02-16T00:40:38.517306998Z  at 
org.apache.ignite.internal.processors.odbc.ClientListenerNioListener.onMessage(ClientListenerNioListener.java:137)
ignite-node <>  2018-02-16T00:40:38.517303719Z  at 
org.apache.ignite.internal.processors.odbc.jdbc.JdbcRequestHandler.handle(JdbcRequestHandler.java:164)
ignite-node <>  2018-02-16T00:40:38.517300511Z  at 
org.apache.ignite.internal.processors.odbc.jdbc.JdbcRequestHandler.executeQuery(JdbcRequestHandler.java:305)
ignite-node <>  2018-02-16T00:40:38.517297178Z  at 
org.apache.ignite.internal.processors.query.GridQueryProcessor.querySqlFieldsNoCache(GridQueryProcessor.java:1971)
ignite-node <>  2018-02-16T00:40:38.517293915Z  at 
org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuery(GridQueryProcessor.java:2445)
ignite-node <>  2018-02-16T00:40:38.517290601Z  at 
org.apache.ignite.internal.util.lang.IgniteOutClosureX.apply(IgniteOutClosureX.java:36)
ignite-node <>  2018-02-16T00:40:38.517287374Z  at 
org.apache.ignite.internal.processors.query.GridQueryProcessor$6.applyx(GridQueryProcessor.java:1962)
ignite-node <>  2018-02-16T00:40:38.517283952Z  at 
org.apache.ignite.internal.processors.query.GridQueryProcessor$6.applyx(GridQueryProcessor.java:1966)
ignite-node <>  2018-02-16T00:40:38.517280022Z  at 
org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.queryDistributedSqlFields(IgniteH2Indexing.java:1385)
ignite-node <>  2018-02-16T00:40:38.517276485Z  
ignite-node <>  2018-02-16T00:40:38.517273303Z  values (?, ?, ?, ?)
ignite-node <>  2018-02-16T00:40:38.517269666Z  class 
org.apache.ignite.internal.processors.query.IgniteSQLException: Failed to parse 
query: insert into device(id, secret, updated_at, created_at)
ignite-node <>  2018-02-16T00:40:38.517265972Z  , 
args=[YmMzZWYxZjUtNzY2OS00YjQ2LWI0NjMtY2M0YjljYTBiNjk4, 
OGNiOWE4NTktMTZkNS00ZDdhLWExYzYtNDdhOTg4OGM4NmFjZTkyY2E0YzItYjY5OS00NjhiLTk5MTgtYzYzOGMxM2ZiZGFk,
 2018-02-16 00:40:38.267, 2018-02-16 00:40:38.267], 
stmtType=ANY_STATEMENT_TYPE]]
ignite-node <>  2018-02-16T00:40:38.517260958Z  values (?, ?, ?, ?)
ignite-node <>  2018-02-16T00:40:38.517190054Z  
[00:40:38,516][SEVERE][client-connector-#48][JdbcRequestHandler] Failed to 
execute SQL query [reqId=0, req=JdbcQueryExecuteRequest [schemaName=PUBLIC, 
pageSize=1024, maxRows=0, sqlQry=insert into device(id, secret, updated_at, 
created_at)
ignite-node <>  2018-02-16T00:25:55.543898181Z  [00:25:55] Topology snapshot 
[ver=3, servers=3, clients=0, CPUs=3, heap=3.0GB]
ignite-node <>  2018-02-16T00:25:55.542032331Z  [00:25:55] Ignite node started 
OK (id=25f7f37d)

I also tried connecting with DBeaver to see what the actual contents of the 
database were now, but DBeaver says 'null connection returned’ when connecting 
to the IP.


Best regards,

Stéphane
> On Feb 15, 2018, at 20:30, Вячеслав Коптилин <[email protected]> wrote:
> 
> Hi  Stéphane,
> 
> The parametrized queries are supported by the thin JDBC driver.
> 
> Could you please share a code snippet that illustrates table 'device' 
> creation and JDBC driver using?
> Please provide the log from the server node. It should contain additional 
> details about the issue.
> 
> Thanks,
> Slava.
> 
> 
> 2018-02-15 11:58 GMT+03:00 Stéphane Thibaud <[email protected] 
> <mailto:[email protected]>>:
> Hello! I am trying to convert our Play Framework application to use Apache 
> Ignite. I encountered a failure to parse an existing query, but I do not see 
> what is so special about this query:
> 
> java.sql.SQLException: Failed to parse query: insert into device(id, secret, 
> updated_at, created_at)
>          values (?, ?, ?, ?)
> 
>         at 
> org.apache.ignite.internal.jdbc.thin.JdbcThinConnection.sendRequest(JdbcThinConnection.java:671)
>  ~[ignite-core-2.3.0.jar:2.3.0]
>         at 
> org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.execute0(JdbcThinStatement.java:130)
>  ~[ignite-core-2.3.0.jar:2.3.0]
>         at 
> org.apache.ignite.internal.jdbc.thin.JdbcThinPreparedStatement.executeWithArguments(JdbcThinPreparedStatement.java:252)
>  ~[ignite-core-2.3.0.jar:2.3.0]
>         at 
> org.apache.ignite.internal.jdbc.thin.JdbcThinPreparedStatement.execute(JdbcThinPreparedStatement.java:240)
>  ~[ignite-core-2.3.0.jar:2.3.0]
>         at 
> com.zaxxer.hikari.proxy.PreparedStatementProxy.execute(PreparedStatementProxy.java:44)
>  ~[HikariCP-2.3.7.jar:na]
>         at 
> com.zaxxer.hikari.proxy.PreparedStatementJavassistProxy.execute(PreparedStatementJavassistProxy.java)
>  ~[HikariCP-2.3.7.jar:na]
>         at anorm.Sql$$anonfun$execute$1.apply(Anorm.scala:235) 
> ~[anorm_2.11-2.4.0.jar:2.4.0]
>         at anorm.Sql$$anonfun$execute$1.apply(Anorm.scala:235) 
> ~[anorm_2.11-2.4.0.jar:2.4.0]
>         at 
> resource.AbstractManagedResource$$anonfun$5.apply(AbstractManagedResource.scala:86)
>  ~[scala-arm_2.11-1.4.jar:1.4]
>         at 
> scala.util.control.Exception$Catch$$anonfun$either$1.apply(Exception.scala:125)
>  ~[scala-library-2.11.8.jar:na]
>         at 
> scala.util.control.Exception$Catch$$anonfun$either$1.apply(Exception.scala:125)
>  ~[scala-library-2.11.8.jar:na]
>         at scala.util.control.Exception$Catch.apply(Exception.scala:103) 
> ~[scala-library-2.11.8.jar:na]
>         at scala.util.control.Exception$Catch.either(Exception.scala:125) 
> ~[scala-library-2.11.8.jar:na]
>         at 
> resource.AbstractManagedResource.acquireFor(AbstractManagedResource.scala:86) 
> ~[scala-arm_2.11-1.4.jar:1.4]
>         at 
> resource.ManagedResourceOperations$class.acquireAndGet(ManagedResourceOperations.scala:25)
>  ~[scala-arm_2.11-1.4.jar:1.4]
>         at 
> resource.AbstractManagedResource.acquireAndGet(AbstractManagedResource.scala:48)
>  ~[scala-arm_2.11-1.4.jar:1.4]
>         at anorm.Sql$class.execute(Anorm.scala:235) 
> ~[anorm_2.11-2.4.0.jar:2.4.0]
>         at anorm.SimpleSql.execute(SimpleSql.scala:6) 
> ~[anorm_2.11-2.4.0.jar:2.4.0]
> 
> Do you have an idea of the issue I might be facing? Are parametrized queries 
> supported by the JDBC driver, for example?
> 
> 
> Best regards,
> 
> Stéphane
> 

Reply via email to