| | |
| | | package com.ximple.eofms.jobs; |
| | | |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.nio.ByteBuffer; |
| | | import java.nio.ByteOrder; |
| | |
| | | import java.sql.Statement; |
| | | import java.sql.Types; |
| | | import java.util.Date; |
| | | import java.io.IOException; |
| | | |
| | | import org.apache.commons.collections.OrderedMap; |
| | | import org.apache.commons.collections.OrderedMapIterator; |
| | |
| | | jobContext.setLogin(_username, _password); |
| | | jobContext.setShapeData(_dataPath); |
| | | jobContext.setExecutionContext(context); |
| | | |
| | | |
| | | try |
| | | { |
| | | copyConnectivity(jobContext); |
| | | exetcuteConvert(jobContext, _orgSchema, _dataPath); |
| | | //exetcuteConvert(jobContext, "CMMS_SPATIALDB", _dataPath); |
| | | for (String orgSchema : _orgSchema) |
| | | { |
| | | exetcuteConvert(jobContext, orgSchema, _dataPath); |
| | | |
| | | //close all open filewriter instance |
| | | jobContext.closeFeatureWrite(); |
| | | //close all open filewriter instance |
| | | jobContext.closeFeatureWrite(); |
| | | } |
| | | } catch (SQLException e) |
| | | { |
| | | logger.warn(e.getMessage(), e); |
| | | throw new JobExecutionException("Database error.", e); |
| | | } catch (IOException ex) { |
| | | } catch (IOException ex) |
| | | { |
| | | ex.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. |
| | | } |
| | | |
| | | } |
| | | |
| | | //Connectivity½Æ»s¤@Óª©¥»¡A¦b¬d¸ß¹q¬y¤è¦V®É¥Î¨Ó¤ñ¹ïOMS¸ê®Æ®wªº¹q¾¹³s±µ©Ê(Connectivity) |
| | | private void copyConnectivity(OracleConvertJobContext jobContext) throws SQLException |
| | | private void copyConnectivity(OracleConvertJobContext jobContext) throws SQLException |
| | | { |
| | | OracleConnection connection = jobContext.getOracleConnection() ; |
| | | Statement stmt = connection.createStatement(); |
| | | stmt.execute(OracleConvertJobContext.TRUNCATE_CONNECTIVITY_WEBCHECK); |
| | | stmt.execute(OracleConvertJobContext.COPY_CONNECTIVITY_TO_WEBCHECK); |
| | | OracleConnection connection = jobContext.getOracleConnection(); |
| | | Statement stmt = connection.createStatement(); |
| | | stmt.execute(OracleConvertJobContext.TRUNCATE_CONNECTIVITY_WEBCHECK); |
| | | stmt.execute(OracleConvertJobContext.COPY_CONNECTIVITY_TO_WEBCHECK); |
| | | } |
| | | |
| | | private void exetcuteConvert(OracleConvertJobContext jobContext, |
| | |
| | | int total = map.size(); //spacenodes count |
| | | int step = total / 100; |
| | | int current = 0; |
| | | |
| | | |
| | | //jobContext.startTransaction(); |
| | | jobContext.getExecutionContext().put("ConvertDgn2ShpJobProgress", 0); |
| | | for (OrderedMapIterator it = map.orderedMapIterator(); it.hasNext();) |
| | |
| | | String fetchSrcStmt = spf.sprintf(new Object[]{srcschema, srctable}); |
| | | Statement stmtSrc = connection.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); |
| | | |
| | | stmtSrc.setFetchSize(FETCHSIZE); |
| | | stmtSrc.setFetchSize(FETCHSIZE); |
| | | |
| | | ResultSet rsSrc = stmtSrc.executeQuery(fetchSrcStmt); |
| | | |