| | |
| | | } |
| | | } |
| | | |
| | | clearExchangeData(jobContext); |
| | | jobContext.closeOracleConnection(); |
| | | } |
| | | |
| | |
| | | (((int) ((tCurrent - tBefore) % 60000.0)) / 1000) + " sec"); |
| | | } |
| | | |
| | | private void clearExchangeData(OracleConvertPostGISJobContext jobContext) throws SQLException, IOException { |
| | | Connection connection = jobContext.getOracleConnection(); |
| | | |
| | | ResultSet rsMeta = connection.getMetaData().getTables(null, "CMMS_POSTDB", "GEO_EXCHANGE", |
| | | new String[]{"TABLE"}); |
| | | |
| | | boolean found = false; |
| | | try { |
| | | while (rsMeta.next()) { |
| | | found = true; |
| | | break; |
| | | } |
| | | // } catch (SQLException e) |
| | | } finally { |
| | | if (rsMeta != null) { |
| | | rsMeta.close(); |
| | | rsMeta = null; |
| | | } |
| | | } |
| | | |
| | | if (!found) { |
| | | logger.info("Cannot Found GEO_EXCHANGE in CMMS_POSTDB."); |
| | | return; |
| | | } |
| | | |
| | | Statement stmt = null; |
| | | try { |
| | | stmt = connection.createStatement(); |
| | | int count = stmt.executeUpdate("UPDATE \"CMMS_POSTDB\".\"GEO_EXCHANGE\" SET ISEXCHANGE=1 WHERE ISEXCHANGE=0"); |
| | | logger.info("GEO_EXCHANGE UPDATE SIZE=" + count); |
| | | } finally { |
| | | JDBCUtils.close(stmt); |
| | | } |
| | | } |
| | | |
| | | private void exetcuteConvert(OracleConvertPostGISJobContext jobContext, |
| | | String querySchema, String targetSchemaName) throws SQLException { |
| | | int order = 0; |