src/applications/h2/src/test/org/h2/test/db/TestSpatial.java
/**
     * Test java alias with Geometry type.
     */
Test java alias with Geometry type.
Test java alias with Geometry type .
private void testJavaAliasTableFunction() throws SQLException {
        deleteDb("spatial");
        Connection conn = getConnection(url);
        try {
            Statement stat = conn.createStatement();
            stat.execute("CREATE ALIAS T_RANDOM_GEOM_TABLE FOR \"" +
                    TestSpatial.class.getName() + ".getRandomGeometryTable\"");
            stat.execute(
                    "create table test as " +
                    "select * from T_RANDOM_GEOM_TABLE(42,20,-100,100,-100,100,4)");
            stat.execute("DROP ALIAS T_RANDOM_GEOM_TABLE");
            ResultSet rs = stat.executeQuery("select count(*) from test");
            assertTrue(rs.next());
            assertEquals(20, rs.getInt(1));
        } finally {
            conn.close();
        }
        deleteDb("spatial");
    }
private void testJavaAliasTableFunction ( ) throws SQLException { deleteDb ( "spatial" ) ; Connection conn = getConnection ( url ) ; try { Statement stat = conn . createStatement ( ) ; stat . execute ( "CREATE ALIAS T_RANDOM_GEOM_TABLE FOR \"" + TestSpatial . class . getName ( ) + ".getRandomGeometryTable\"" ) ; stat . execute ( "create table test as " + "select * from T_RANDOM_GEOM_TABLE(42,20,-100,100,-100,100,4)" ) ; stat . execute ( "DROP ALIAS T_RANDOM_GEOM_TABLE" ) ; ResultSet rs = stat . executeQuery ( "select count(*) from test" ) ; assertTrue ( rs . next ( ) ) ; assertEquals ( 20 , rs . getInt ( 1 ) ) ; } finally { conn . close ( ) ; } deleteDb ( "spatial" ) ; }
Test java alias with Geometry type.
Test java alias with Geometry type .