| | |
| | | logger.info(jobName + " fired at " + new Date()); |
| | | extractJobConfiguration(jobDetail); |
| | | |
| | | OracleConvertJobContext jobContext = (OracleConvertJobContext) prepareJobContext(_filterPath); |
| | | jobContext.setConnectionInfo(_oracleHost, _oraclePort, _oracleInstance); |
| | | jobContext.setLogin(_username, _password); |
| | | jobContext.setShapeData(_dataPath); |
| | | jobContext.setExecutionContext(context); |
| | | |
| | | try |
| | | { |
| | | copyConnectivity(jobContext); |
| | | boolean bFirst = true; |
| | | for (String orgSchema : _orgSchema) |
| | | { |
| | | OracleConvertJobContext jobContext = (OracleConvertJobContext) prepareJobContext(_filterPath); |
| | | jobContext.setConnectionInfo(_oracleHost, _oraclePort, _oracleInstance); |
| | | jobContext.setLogin(_username, _password); |
| | | jobContext.setShapeData(_dataPath); |
| | | jobContext.setExecutionContext(context); |
| | | |
| | | if (bFirst) |
| | | copyConnectivity(jobContext); |
| | | else |
| | | bFirst = false; |
| | | |
| | | logger.info("----- start schema:" + orgSchema + " -----"); |
| | | exetcuteConvert(jobContext, orgSchema, _dataPath); |
| | | |
| | | //close all open filewriter instance |
| | |
| | | } catch (SQLException e) |
| | | { |
| | | logger.warn(e.getMessage(), e); |
| | | throw new JobExecutionException("Database error.", e); |
| | | throw new JobExecutionException("Database error. " + e.getMessage(), e); |
| | | } catch (IOException ex) |
| | | { |
| | | ex.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. |
| | | logger.warn(ex.getMessage(), ex); |
| | | throw new JobExecutionException("IO error. " + ex.getMessage(), ex); |
| | | } |
| | | |
| | | } |
| | | |
| | | //Connectivity½Æ»s¤@Óª©¥»¡A¦b¬d¸ß¹q¬y¤è¦V®É¥Î¨Ó¤ñ¹ïOMS¸ê®Æ®wªº¹q¾¹³s±µ©Ê(Connectivity) |
| | |
| | | PrintfFormat spf = new PrintfFormat(fetchStmtFmt); |
| | | String fetchStmt = spf.sprintf(new Object[]{schemaSrc, tableSrc}); |
| | | Statement stmt = connection.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); |
| | | ResultSet rs = null; |
| | | |
| | | stmt.setFetchSize(FETCHSIZE); |
| | | |
| | | ResultSet rs = stmt.executeQuery(fetchStmt); |
| | | try |
| | | { |
| | | rs = stmt.executeQuery(fetchStmt); |
| | | |
| | | while (rs.next()) |
| | | { |
| | |
| | | else |
| | | pair.first = name; |
| | | } |
| | | |
| | | rs.close(); |
| | | stmt.close(); |
| | | } catch (SQLException e) |
| | | { |
| | | logger.error(e.toString(), e); |
| | | logger.error("stmt=" + fetchStmt); |
| | | throw e; |
| | | } finally |
| | | { |
| | | if (rs != null) rs.close(); |
| | | stmt.close(); |
| | | } |
| | | |
| | | return orderedMap; |
| | | } |