Cache,table and index created through QueryEntities.
like below
             
cacheCfg = new CacheConfiguration
{
        ...
        QueryEntities = queryList,
        ...
        
};
here is the code i am executing
public static void main( String[] args ) throws ClassNotFoundException,
SQLException
    {   
                System.out.println( "main start!" );                            
        
                // Register JDBC driver.
                Class.forName("org.apache.ignite.IgniteJdbcThinDriver");
                 
                // Open the JDBC connection.
                Connection conn =
DriverManager.getConnection("jdbc:ignite:thin://localhost/9E7B08B5-3BFD-4026-B322-C4A34FFFAFD7");//cacheName
                 
                /*
                        //Select query...
                        Statement stmt = conn.createStatement();
                        String query = "select * from
\"9E7B08B5-3BFD-4026-B322-C4A34FFFAFD7\".ENTITIESTABLEINFO";
                        boolean status = stmt.execute(query);
                        if(status){
                                ResultSet rs = stmt.getResultSet();
                                while(rs.next()){
                                        System.out.println(rs.getString(1));
                                }
                                rs.close();
                        }*/
                
                String sqlQuery = "INSERT INTO ENTITIESTABLEINFO
(ENTITYID,ENTITYINFOJSON,ENTITYNAME,ENTITYTYPE,FABRIC,SEQUENCENUMBER,TENANTID,TENANTNAME)"
                    + " VALUES(?, ?, ?, ?,?,?,?,?)";
                    PreparedStatement prepStmt = 
conn.prepareStatement(sqlQuery);
                    prepStmt.setString(1, "pulsarTesting-1-1-1-1-EntityId"); 
                    prepStmt.setString(2, "{}");
                    prepStmt.setString(3, "PulsarEntityName");
                    prepStmt.setString(4, "PulsarEntityType");
                    prepStmt.setString(5, "PulsarFabric"); 
                    prepStmt.setDouble(6, 123.0);
                    prepStmt.setString(7, "pulsar-TenantId");
                    prepStmt.setString(8, "PulsarTenant");
                    
                    prepStmt.execute();
                
                System.out.println("Statement executed...");
    }

here is an Exception:

Exception in thread "main" java.sql.SQLException: Failed to execute DML
statement [stmt=INSERT INTO ENTITIESTABLEINFO
(ENTITYID,ENTITYINFOJSON,ENTITYNAME,ENTITYTYPE,FABRIC,SEQUENCENUMBER,TENANTID,TENANTNAME)
VALUES(?, ?, ?, ?,?,?,?,?), params=[pulsarTesting-1-1-1-1-EntityId, aa,
PulsarEntityName, PulsarEntityType, PulsarFabric, 123.0, pulsar-TenantId,
PulsarTenant]]
        at
org.apache.ignite.internal.jdbc.thin.JdbcThinConnection.sendRequest(JdbcThinConnection.java:750)
        at
org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.execute0(JdbcThinStatement.java:212)
        at
org.apache.ignite.internal.jdbc.thin.JdbcThinPreparedStatement.executeWithArguments(JdbcThinPreparedStatement.java:252)
        at
org.apache.ignite.internal.jdbc.thin.JdbcThinPreparedStatement.execute(JdbcThinPreparedStatement.java:240)
        at 
org.apache.pulsar.io.jdbc.javaclienttest.project.App.main(App.java:133)




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Reply via email to