ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan Zeng <ivanzen...@gmail.com>
Subject create table via JDBC
Date Thu, 16 Mar 2017 18:46:32 GMT
Hi,

I am new to Ignite.  Could you tell me the right way to create a
cache, load data into cache, and then query the cache via JDBC?

I wrote the following code to create a table via JDBC.


    Class.forName("org.apache.ignite.IgniteJdbcDriver");
    con = DriverManager.getConnection (connectionURL)
    String create_sql = "CREATE TABLE Person " +
                  "(_key INTEGER PRIMARY KEY, " +
                  " name VARCHAR(255), " +
                  " age INTEGER);";
    Statement cstmt = con.createStatement();
    cstmt.executeQuery(create_sql);


But i got this error.

java.sql.SQLException: Failed to query Ignite.
at org.apache.ignite.internal.jdbc2.JdbcStatement.executeQuery(JdbcStatement.java:131)
at IgniteJDBC.main(IgniteJDBC.java:26)
Caused by: javax.cache.CacheException: Unsupported SQL statement:
CREATE TABLE Person (_key INTEGER PRIMARY KEY,  name VARCHAR(255),
age INTEGER)

Thanks so much
Ivan

Mime
View raw message