Search in sources :

Example 11 with Prepared

use of org.h2.command.Prepared in project ignite by apache.

the class GridQueryParsingTest method assertDropTableEquals.

/**
     * Parse SQL and compare it to expected instance of DROP TABLE.
     */
private void assertDropTableEquals(GridSqlDropTable exp, String sql) throws Exception {
    Prepared prepared = parse(sql);
    GridSqlStatement stmt = new GridSqlQueryParser(false).parse(prepared);
    assertTrue(stmt instanceof GridSqlDropTable);
    assertDropTableEquals(exp, (GridSqlDropTable) stmt);
}
Also used : Prepared(org.h2.command.Prepared)

Example 12 with Prepared

use of org.h2.command.Prepared in project ignite by apache.

the class GridQueryParsingTest method assertDropIndexEquals.

/**
     * Parse SQL and compare it to expected instance of DROP INDEX.
     */
private void assertDropIndexEquals(GridSqlDropIndex exp, String sql) throws Exception {
    Prepared prepared = parse(sql);
    GridSqlStatement stmt = new GridSqlQueryParser(false).parse(prepared);
    assertTrue(stmt instanceof GridSqlDropIndex);
    assertDropIndexEquals(exp, (GridSqlDropIndex) stmt);
}
Also used : Prepared(org.h2.command.Prepared)

Example 13 with Prepared

use of org.h2.command.Prepared in project ignite by apache.

the class GridQueryParsingTest method assertCreateTableEquals.

/**
     * Parse SQL and compare it to expected instance of DROP TABLE.
     */
private void assertCreateTableEquals(GridSqlCreateTable exp, String sql) throws Exception {
    Prepared prepared = parse(sql);
    GridSqlStatement stmt = new GridSqlQueryParser(false).parse(prepared);
    assertTrue(stmt instanceof GridSqlCreateTable);
    assertCreateTableEquals(exp, (GridSqlCreateTable) stmt);
}
Also used : Prepared(org.h2.command.Prepared)

Example 14 with Prepared

use of org.h2.command.Prepared in project ignite by apache.

the class GridQueryParsingTest method assertCreateIndexEquals.

/**
     * Parse SQL and compare it to expected instance.
     */
private void assertCreateIndexEquals(GridSqlCreateIndex exp, String sql) throws Exception {
    Prepared prepared = parse(sql);
    GridSqlStatement stmt = new GridSqlQueryParser(false).parse(prepared);
    assertTrue(stmt instanceof GridSqlCreateIndex);
    assertCreateIndexEquals(exp, (GridSqlCreateIndex) stmt);
}
Also used : Prepared(org.h2.command.Prepared)

Aggregations

Prepared (org.h2.command.Prepared)12 PreparedStatement (java.sql.PreparedStatement)4 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)4 IgniteSQLException (org.apache.ignite.internal.processors.query.IgniteSQLException)4 JdbcPreparedStatement (org.h2.jdbc.JdbcPreparedStatement)4 Connection (java.sql.Connection)3 SQLException (java.sql.SQLException)3 ArrayList (java.util.ArrayList)3 List (java.util.List)3 JdbcSqlFieldsQuery (org.apache.ignite.internal.jdbc2.JdbcSqlFieldsQuery)2 QueryCursorImpl (org.apache.ignite.internal.processors.cache.QueryCursorImpl)2 GridCacheTwoStepQuery (org.apache.ignite.internal.processors.cache.query.GridCacheTwoStepQuery)2 GridQueryFieldMetadata (org.apache.ignite.internal.processors.query.GridQueryFieldMetadata)2 UpdatePlan (org.apache.ignite.internal.processors.query.h2.dml.UpdatePlan)2 GridH2QueryContext (org.apache.ignite.internal.processors.query.h2.opt.GridH2QueryContext)2 ResultSet (java.sql.ResultSet)1 Iterator (java.util.Iterator)1 LinkedHashMap (java.util.LinkedHashMap)1 LinkedHashSet (java.util.LinkedHashSet)1 UUID (java.util.UUID)1