| | |
| | | import java.sql.SQLException; |
| | | import java.sql.Statement; |
| | | import java.sql.Types; |
| | | import java.sql.Connection; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | |
| | | |
| | | protected Map<String, String> pgProperties; |
| | | protected PostgisDataStore targetDataStore; |
| | | |
| | | /* |
| | | PostgisDataStore pg = new PostgisDataStore(pool, f.schema, getName(), |
| | | PostgisDataStore.OPTIMIZE_SQL); |
| | | pg.setWKBEnabled(WKB_ENABLED); |
| | | pg.setEstimatedExtent(true); |
| | | pg.setFIDMapper("road", new TypedFIDMapper(new BasicFIDMapper("fid", 255, false), "road")); |
| | | pg.setFIDMapper("river", new TypedFIDMapper(new BasicFIDMapper("fid", 255, false), "river")); |
| | | pg.setFIDMapper("testset", |
| | | new TypedFIDMapper(new BasicFIDMapper("gid", 255, true), "testset")); |
| | | |
| | | */ |
| | | /* |
| | | Transaction transaction = new DefaultTransaction("attemptWriteFW"); |
| | | FeatureWriter writer = ds.getFeatureWriter(table, transaction); |
| | | Feature feature; |
| | | |
| | | while (writer.hasNext()) { |
| | | feature = (Feature) writer.next(); |
| | | } |
| | | |
| | | feature = (Feature) writer.next(); |
| | | feature.setAttribute(0, "test"); |
| | | writer.write(); |
| | | |
| | | String id = feature.getID(); |
| | | transaction.commit(); |
| | | transaction.close(); |
| | | |
| | | */ |
| | | // protected OracleConvertPostGISJobContext oracleJobContext; |
| | | |
| | | public Log getLogger() |
| | | { |
| | |
| | | |
| | | protected AbstractOracleJobContext prepareJobContext(String filterPath) |
| | | { |
| | | /* |
| | | if (oracleJobContext == null) |
| | | { |
| | | oracleJobContext = new OracleConvertPostGISJobContext(getDataPath(), getTargetDataStore(), filterPath); |
| | | } |
| | | return oracleJobContext; |
| | | */ |
| | | return new OracleConvertPostGISJobContext(getDataPath(), getTargetDataStore(), filterPath); |
| | | } |
| | | |
| | |
| | | { |
| | | logger.info("-- step:clearOutputDatabase --"); |
| | | clearOutputDatabase(); |
| | | boolean bFirst = true; |
| | | boolean bFirst = isCopyConnectivityMode(); |
| | | if (checkConvertDB()) |
| | | { |
| | | logger.info("-- step:convertOracleDB --"); |
| | |
| | | */ |
| | | private void copyConnectivity(OracleConvertPostGISJobContext jobContext) throws SQLException |
| | | { |
| | | OracleConnection connection = jobContext.getOracleConnection(); |
| | | Connection connection = jobContext.getOracleConnection(); |
| | | Statement stmt = connection.createStatement(); |
| | | stmt.execute(AbstractOracleJobContext.TRUNCATE_CONNECTIVITY_WEBCHECK); |
| | | stmt.execute(AbstractOracleJobContext.COPY_CONNECTIVITY_TO_WEBCHECK); |
| | |
| | | String querySchema, String dataPath) throws SQLException |
| | | { |
| | | int order = 0; |
| | | OrderedMap map = getBlobStorageList(jobContext.getOracleConnection(), querySchema, "SD$SPACENODES" |
| | | , null); |
| | | OrderedMap map = getBlobStorageList(jobContext.getOracleConnection(), |
| | | querySchema, "SD$SPACENODES" , null); |
| | | |
| | | logger.info("begin convert job:[" + map.size() + "]:testmode=" + _testMode); |
| | | |
| | |
| | | jobContext.getExecutionContext().put("ConvertDgn2PostGISJobProgress", 100); |
| | | |
| | | jobContext.commitTransaction(); |
| | | |
| | | jobContext.resetFeatureContext(); |
| | | logger.info("end convert job:[" + order + "]"); |
| | | System.gc(); |
| | | } |
| | | |
| | | protected OrderedMap getBlobStorageList(OracleConnection connection, String schemaSrc, String tableSrc, |
| | | protected OrderedMap getBlobStorageList(Connection connection, String schemaSrc, String tableSrc, |
| | | OrderedMap orderedMap) throws SQLException |
| | | { |
| | | if (orderedMap == null) |
| | |
| | | protected void queryIgsetElement(OracleConvertPostGISJobContext jobContext, |
| | | String srcschema, String srctable) throws SQLException |
| | | { |
| | | OracleConnection connection = jobContext.getOracleConnection(); |
| | | Connection connection = jobContext.getOracleConnection(); |
| | | String fetchSrcStmtFmt = "SELECT IGDSELM FROM \"%s\".\"%s\" ORDER BY ROWID"; |
| | | PrintfFormat spf = new PrintfFormat(fetchSrcStmtFmt); |
| | | String fetchSrcStmt = spf.sprintf(new Object[]{srcschema, srctable}); |
| | |
| | | protected void queryRawElement(OracleConvertPostGISJobContext jobContext, |
| | | String srcschema, String srctable) throws SQLException |
| | | { |
| | | OracleConnection connection = jobContext.getOracleConnection(); |
| | | Connection connection = jobContext.getOracleConnection(); |
| | | String fetchDestStmtFmt = "SELECT ELEMENT FROM \"%s\".\"%s\" ORDER BY ROWID"; |
| | | PrintfFormat spf = new PrintfFormat(fetchDestStmtFmt); |
| | | String fetchDestStmt = spf.sprintf(new Object[]{srcschema, srctable}); |