@Override protected void dropSkipColumnTable() throws Exception { Connection con = getDataSource().getConnection(); DB2Util.executeUnRegister(DB2TestUtil.SCHEMA, "skipcolumn", "geom", con); con.prepareStatement("DROP TABLE " + DB2TestUtil.SCHEMA_QUOTED + ".\"skipcolumn\"").execute(); con.close(); }
@Override protected void createSkipColumnTable() throws Exception { Connection con = getDataSource().getConnection(); String stmt = "create table " + DB2TestUtil.SCHEMA_QUOTED + ".\"skipcolumn\" (\"fid\" int generated always as identity (start with 0, increment by 1)," + "\"id\" int ," + " \"geom\" DB2GSE.ST_GEOMETRY, " + "\"weirdproperty\" XML, " + "\"name\" varchar(255), " + "primary key (\"fid\"))"; con.prepareStatement(stmt).execute(); DB2Util.executeRegister(DB2TestUtil.SCHEMA, "auto", "geom", DB2TestUtil.SRSNAME, con); con.prepareStatement( "INSERT INTO " + DB2TestUtil.SCHEMA_QUOTED + ".\"skipcolumn\" " + "(\"id\",\"geom\",\"weirdproperty\",\"name\") " + "VALUES (0, db2gse.st_GeomFromText('POINT(0 0)', " + DB2TestUtil.SRID + "), null, 'GeoTools')") .execute(); con.close(); }
@Override protected void dropLakesView() throws Exception { Connection con = getDataSource().getConnection(); DB2Util.executeUnRegister(DB2TestUtil.SCHEMA, "lakesview", "geom", con); DB2TestUtil.dropView(DB2TestUtil.SCHEMA, "lakesview", con); con.close(); }
@Override protected void createLakesView() throws Exception { Connection con = getDataSource().getConnection(); con.prepareStatement( "create view " + DB2TestUtil.SCHEMA_QUOTED + ".\"lakesview\" " + " as select * from " + DB2TestUtil.SCHEMA_QUOTED + ".\"lakes\" ") .execute(); DB2Util.executeRegister(DB2TestUtil.SCHEMA, "lakesview", "geom", DB2TestUtil.SRSNAME, con); con.close(); }
@Override protected void createLakesTable() throws Exception { Connection con = getDataSource().getConnection(); String statement = "create table " + DB2TestUtil.SCHEMA_QUOTED + ".\"lakes\"" + "(\"fid\" int not null , \"id\" int, \"geom\" db2gse.st_polygon, \"name\" varchar(32), primary key (\"fid\") )"; con.prepareStatement(statement).execute(); statement = "INSERT INTO " + DB2TestUtil.SCHEMA_QUOTED + ".\"lakes\" (\"fid\", \"id\",\"geom\",\"name\") VALUES ( 0, 0," + "db2gse.st_PolyFromText('POLYGON((12 6, 14 8, 16 6, 16 4, 14 4, 12 6))'," + DB2TestUtil.SRID + ")," + "'muddy')"; con.prepareStatement(statement).execute(); DB2Util.executeRegister(DB2TestUtil.SCHEMA, "lakes", "geom", DB2TestUtil.SRSNAME, con); con.close(); }