List of usage examples for java.sql ResultSet getByte
byte getByte(String columnLabel) throws SQLException;
ResultSet
object as a byte
in the Java programming language. From source file:talonetl.getproperties_0_2.getProperties.java
public void tMysqlInput_3Process(final java.util.Map<String, Object> globalMap) throws TalendException { globalMap.put("tMysqlInput_3_SUBPROCESS_STATE", 0); final boolean execStat = this.execStat; String iterateId = ""; int iterateLoop = 0; String currentComponent = ""; try {/* ww w . j a va 2 s . c om*/ String currentMethodName = new Exception().getStackTrace()[0].getMethodName(); boolean resumeIt = currentMethodName.equals(resumeEntryMethodName); if (resumeEntryMethodName == null || resumeIt || globalResumeTicket) {// start // the // resume globalResumeTicket = true; tMysqlInput_4Process(globalMap); row7Struct row7 = new row7Struct(); custDataStruct custData = new custDataStruct(); /** * [tAdvancedHash_custData begin ] start */ ok_Hash.put("tAdvancedHash_custData", false); start_Hash.put("tAdvancedHash_custData", System.currentTimeMillis()); currentComponent = "tAdvancedHash_custData"; int tos_count_tAdvancedHash_custData = 0; // connection name:custData // source node:tMap_11 - inputs:(row8,row7) // outputs:(custData,custData) | target // node:tAdvancedHash_custData - inputs:(custData) outputs:() // linked node: tMap_4 - inputs:(mappedData,custData) // outputs:(loadData) org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE matchingModeEnum_custData = org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE.UNIQUE_MATCH; org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<custDataStruct> tHash_Lookup_custData = org.talend.designer.components.lookup.memory.AdvancedMemoryLookup .<custDataStruct>getLookup(matchingModeEnum_custData); globalMap.put("tHash_Lookup_custData", tHash_Lookup_custData); /** * [tAdvancedHash_custData begin ] stop */ /** * [tMap_11 begin ] start */ ok_Hash.put("tMap_11", false); start_Hash.put("tMap_11", System.currentTimeMillis()); currentComponent = "tMap_11"; int tos_count_tMap_11 = 0; // ############################### // # Lookup's keys initialization org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row8Struct> tHash_Lookup_row8 = (org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row8Struct>) ((org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row8Struct>) globalMap .get("tHash_Lookup_row8")); row8Struct row8HashKey = new row8Struct(); row8Struct row8Default = new row8Struct(); // ############################### // ############################### // # Vars initialization class Var__tMap_11__Struct { } Var__tMap_11__Struct Var__tMap_11 = new Var__tMap_11__Struct(); // ############################### // ############################### // # Outputs initialization custDataStruct custData_tmp = new custDataStruct(); // ############################### /** * [tMap_11 begin ] stop */ /** * [tMysqlInput_3 begin ] start */ ok_Hash.put("tMysqlInput_3", false); start_Hash.put("tMysqlInput_3", System.currentTimeMillis()); currentComponent = "tMysqlInput_3"; int tos_count_tMysqlInput_3 = 0; java.util.Calendar calendar_tMysqlInput_3 = java.util.Calendar.getInstance(); calendar_tMysqlInput_3.set(0, 0, 0, 0, 0, 0); java.util.Date year0_tMysqlInput_3 = calendar_tMysqlInput_3.getTime(); int nb_line_tMysqlInput_3 = 0; java.sql.Connection conn_tMysqlInput_3 = null; java.util.Map<String, routines.system.TalendDataSource> dataSources_tMysqlInput_3 = (java.util.Map<String, routines.system.TalendDataSource>) globalMap .get(KEY_DB_DATASOURCES); if (null != dataSources_tMysqlInput_3) { conn_tMysqlInput_3 = dataSources_tMysqlInput_3.get("").getConnection(); } else { java.lang.Class.forName("org.gjt.mm.mysql.Driver"); String url_tMysqlInput_3 = "jdbc:mysql://" + "192.168.1.254" + ":" + "3306" + "/" + "TALONDB" + "?" + "noDatetimeStringSync=true"; String dbUser_tMysqlInput_3 = "dbAdmin"; String dbPwd_tMysqlInput_3 = "1nn0s2013"; conn_tMysqlInput_3 = java.sql.DriverManager.getConnection(url_tMysqlInput_3, dbUser_tMysqlInput_3, dbPwd_tMysqlInput_3); } java.sql.Statement stmt_tMysqlInput_3 = conn_tMysqlInput_3.createStatement(); String dbquery_tMysqlInput_3 = "SELECT `CUSTOMER`.`ID`, `CUSTOMER`.`UUID`, `CUSTOMER`.`CUST_NAME`, `CUSTOMER`.`ENABLED` FROM `CUSTOMER` "; globalMap.put("tMysqlInput_3_QUERY", dbquery_tMysqlInput_3); java.sql.ResultSet rs_tMysqlInput_3 = stmt_tMysqlInput_3.executeQuery(dbquery_tMysqlInput_3); java.sql.ResultSetMetaData rsmd_tMysqlInput_3 = rs_tMysqlInput_3.getMetaData(); int colQtyInRs_tMysqlInput_3 = rsmd_tMysqlInput_3.getColumnCount(); String tmpContent_tMysqlInput_3 = null; while (rs_tMysqlInput_3.next()) { nb_line_tMysqlInput_3++; if (colQtyInRs_tMysqlInput_3 < 1) { row7.ID = 0; } else { if (rs_tMysqlInput_3.getObject(1) != null) { row7.ID = rs_tMysqlInput_3.getInt(1); } else { throw new RuntimeException("Null value in non-Nullable column"); } } if (colQtyInRs_tMysqlInput_3 < 2) { row7.UUID = null; } else { tmpContent_tMysqlInput_3 = rs_tMysqlInput_3.getString(2); if (tmpContent_tMysqlInput_3 != null) { row7.UUID = tmpContent_tMysqlInput_3; } else { row7.UUID = null; } } if (colQtyInRs_tMysqlInput_3 < 3) { row7.CUST_NAME = null; } else { tmpContent_tMysqlInput_3 = rs_tMysqlInput_3.getString(3); if (tmpContent_tMysqlInput_3 != null) { row7.CUST_NAME = tmpContent_tMysqlInput_3; } else { row7.CUST_NAME = null; } } if (colQtyInRs_tMysqlInput_3 < 4) { row7.ENABLED = 0; } else { if (rs_tMysqlInput_3.getObject(4) != null) { row7.ENABLED = rs_tMysqlInput_3.getByte(4); } else { throw new RuntimeException("Null value in non-Nullable column"); } } /** * [tMysqlInput_3 begin ] stop */ /** * [tMysqlInput_3 main ] start */ currentComponent = "tMysqlInput_3"; tos_count_tMysqlInput_3++; /** * [tMysqlInput_3 main ] stop */ /** * [tMap_11 main ] start */ currentComponent = "tMap_11"; boolean hasCasePrimitiveKeyWithNull_tMap_11 = false; // ############################### // # Input tables (lookups) boolean rejectedInnerJoin_tMap_11 = false; boolean mainRowRejected_tMap_11 = false; // ///////////////////////////////////////////// // Starting Lookup Table "row8" // ///////////////////////////////////////////// boolean forceLooprow8 = false; row8Struct row8ObjectFromLookup = null; if (!rejectedInnerJoin_tMap_11) { // G_TM_M_020 hasCasePrimitiveKeyWithNull_tMap_11 = false; row8HashKey.CUST_UUID = row7.UUID; row8HashKey.hashCodeDirty = true; tHash_Lookup_row8.lookup(row8HashKey); if (!tHash_Lookup_row8.hasNext()) { // G_TM_M_090 rejectedInnerJoin_tMap_11 = true; } // G_TM_M_090 } // G_TM_M_020 if (tHash_Lookup_row8 != null && tHash_Lookup_row8.getCount(row8HashKey) > 1) { // G // 071 // System.out.println("WARNING: UNIQUE MATCH is configured for the lookup 'row8' and it contains more one result from keys : row8.CUST_UUID = '" // + row8HashKey.CUST_UUID + "'"); } // G 071 row8Struct row8 = null; row8Struct fromLookup_row8 = null; row8 = row8Default; if (tHash_Lookup_row8 != null && tHash_Lookup_row8.hasNext()) { // G 099 fromLookup_row8 = tHash_Lookup_row8.next(); } // G 099 if (fromLookup_row8 != null) { row8 = fromLookup_row8; } // ############################### { // start of Var scope // ############################### // # Vars tables Var__tMap_11__Struct Var = Var__tMap_11;// ############################### // ############################### // # Output tables custData = null; if (!rejectedInnerJoin_tMap_11) { // # Output table : 'custData' custData_tmp.CUST_NAME = row7.CUST_NAME; custData_tmp.DATA_SOURCE_ID = row8.ID; custData = custData_tmp; } // closing inner join bracket (2) // ############################### } // end of Var scope rejectedInnerJoin_tMap_11 = false; tos_count_tMap_11++; /** * [tMap_11 main ] stop */ // Start of branch "custData" if (custData != null) { /** * [tAdvancedHash_custData main ] start */ currentComponent = "tAdvancedHash_custData"; custDataStruct custData_HashRow = new custDataStruct(); custData_HashRow.CUST_NAME = custData.CUST_NAME; custData_HashRow.DATA_SOURCE_ID = custData.DATA_SOURCE_ID; tHash_Lookup_custData.put(custData_HashRow); tos_count_tAdvancedHash_custData++; /** * [tAdvancedHash_custData main ] stop */ } // End of branch "custData" /** * [tMysqlInput_3 end ] start */ currentComponent = "tMysqlInput_3"; } rs_tMysqlInput_3.close(); stmt_tMysqlInput_3.close(); conn_tMysqlInput_3.close(); globalMap.put("tMysqlInput_3_NB_LINE", nb_line_tMysqlInput_3); ok_Hash.put("tMysqlInput_3", true); end_Hash.put("tMysqlInput_3", System.currentTimeMillis()); /** * [tMysqlInput_3 end ] stop */ /** * [tMap_11 end ] start */ currentComponent = "tMap_11"; // ############################### // # Lookup hashes releasing if (tHash_Lookup_row8 != null) { tHash_Lookup_row8.endGet(); } globalMap.remove("tHash_Lookup_row8"); // ############################### ok_Hash.put("tMap_11", true); end_Hash.put("tMap_11", System.currentTimeMillis()); /** * [tMap_11 end ] stop */ /** * [tAdvancedHash_custData end ] start */ currentComponent = "tAdvancedHash_custData"; tHash_Lookup_custData.endPut(); ok_Hash.put("tAdvancedHash_custData", true); end_Hash.put("tAdvancedHash_custData", System.currentTimeMillis()); /** * [tAdvancedHash_custData end ] stop */ } // end the resume } catch (Exception e) { throw new TalendException(e, currentComponent, globalMap); } catch (java.lang.Error error) { throw new java.lang.Error(error); } finally { // free memory for "tMap_11" globalMap.put("tHash_Lookup_row8", null); } globalMap.put("tMysqlInput_3_SUBPROCESS_STATE", 1); }
From source file:talonetl.getproperties_0_4.getProperties.java
public void tMysqlInput_3Process(final java.util.Map<String, Object> globalMap) throws TalendException { globalMap.put("tMysqlInput_3_SUBPROCESS_STATE", 0); final boolean execStat = this.execStat; String iterateId = ""; int iterateLoop = 0; String currentComponent = ""; try {/*from w w w . j a va 2s .c om*/ String currentMethodName = new Exception().getStackTrace()[0].getMethodName(); boolean resumeIt = currentMethodName.equals(resumeEntryMethodName); if (resumeEntryMethodName == null || resumeIt || globalResumeTicket) {// start // the // resume globalResumeTicket = true; tMysqlInput_4Process(globalMap); row7Struct row7 = new row7Struct(); custDataStruct custData = new custDataStruct(); /** * [tAdvancedHash_custData begin ] start */ ok_Hash.put("tAdvancedHash_custData", false); start_Hash.put("tAdvancedHash_custData", System.currentTimeMillis()); currentComponent = "tAdvancedHash_custData"; int tos_count_tAdvancedHash_custData = 0; // connection name:custData // source node:tMap_11 - inputs:(row8,row7) // outputs:(custData,custData) | target // node:tAdvancedHash_custData - inputs:(custData) outputs:() // linked node: tMap_4 - inputs:(mappedData,custData) // outputs:(loadData) org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE matchingModeEnum_custData = org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE.UNIQUE_MATCH; org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<custDataStruct> tHash_Lookup_custData = org.talend.designer.components.lookup.memory.AdvancedMemoryLookup .<custDataStruct>getLookup(matchingModeEnum_custData); globalMap.put("tHash_Lookup_custData", tHash_Lookup_custData); /** * [tAdvancedHash_custData begin ] stop */ /** * [tMap_11 begin ] start */ ok_Hash.put("tMap_11", false); start_Hash.put("tMap_11", System.currentTimeMillis()); currentComponent = "tMap_11"; int tos_count_tMap_11 = 0; // ############################### // # Lookup's keys initialization org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row8Struct> tHash_Lookup_row8 = (org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row8Struct>) ((org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row8Struct>) globalMap .get("tHash_Lookup_row8")); row8Struct row8HashKey = new row8Struct(); row8Struct row8Default = new row8Struct(); // ############################### // ############################### // # Vars initialization class Var__tMap_11__Struct { } Var__tMap_11__Struct Var__tMap_11 = new Var__tMap_11__Struct(); // ############################### // ############################### // # Outputs initialization custDataStruct custData_tmp = new custDataStruct(); // ############################### /** * [tMap_11 begin ] stop */ /** * [tMysqlInput_3 begin ] start */ ok_Hash.put("tMysqlInput_3", false); start_Hash.put("tMysqlInput_3", System.currentTimeMillis()); currentComponent = "tMysqlInput_3"; int tos_count_tMysqlInput_3 = 0; java.util.Calendar calendar_tMysqlInput_3 = java.util.Calendar.getInstance(); calendar_tMysqlInput_3.set(0, 0, 0, 0, 0, 0); java.util.Date year0_tMysqlInput_3 = calendar_tMysqlInput_3.getTime(); int nb_line_tMysqlInput_3 = 0; java.sql.Connection conn_tMysqlInput_3 = null; java.util.Map<String, routines.system.TalendDataSource> dataSources_tMysqlInput_3 = (java.util.Map<String, routines.system.TalendDataSource>) globalMap .get(KEY_DB_DATASOURCES); if (null != dataSources_tMysqlInput_3) { conn_tMysqlInput_3 = dataSources_tMysqlInput_3.get("").getConnection(); } else { java.lang.Class.forName("org.gjt.mm.mysql.Driver"); String url_tMysqlInput_3 = "jdbc:mysql://" + "192.168.1.201" + ":" + "3306" + "/" + "TALONDB" + "?" + "noDatetimeStringSync=true"; String dbUser_tMysqlInput_3 = "dbAdmin"; String dbPwd_tMysqlInput_3 = "1nn0s2013"; conn_tMysqlInput_3 = java.sql.DriverManager.getConnection(url_tMysqlInput_3, dbUser_tMysqlInput_3, dbPwd_tMysqlInput_3); } java.sql.Statement stmt_tMysqlInput_3 = conn_tMysqlInput_3.createStatement(); String dbquery_tMysqlInput_3 = "SELECT `CUSTOMER`.`ID`, `CUSTOMER`.`UUID`, `CUSTOMER`.`CUST_NAME`, `CUSTOMER`.`ENABLED` FROM `CUSTOMER` "; globalMap.put("tMysqlInput_3_QUERY", dbquery_tMysqlInput_3); java.sql.ResultSet rs_tMysqlInput_3 = stmt_tMysqlInput_3.executeQuery(dbquery_tMysqlInput_3); java.sql.ResultSetMetaData rsmd_tMysqlInput_3 = rs_tMysqlInput_3.getMetaData(); int colQtyInRs_tMysqlInput_3 = rsmd_tMysqlInput_3.getColumnCount(); String tmpContent_tMysqlInput_3 = null; while (rs_tMysqlInput_3.next()) { nb_line_tMysqlInput_3++; if (colQtyInRs_tMysqlInput_3 < 1) { row7.ID = 0; } else { if (rs_tMysqlInput_3.getObject(1) != null) { row7.ID = rs_tMysqlInput_3.getInt(1); } else { throw new RuntimeException("Null value in non-Nullable column"); } } if (colQtyInRs_tMysqlInput_3 < 2) { row7.UUID = null; } else { tmpContent_tMysqlInput_3 = rs_tMysqlInput_3.getString(2); if (tmpContent_tMysqlInput_3 != null) { row7.UUID = tmpContent_tMysqlInput_3; } else { row7.UUID = null; } } if (colQtyInRs_tMysqlInput_3 < 3) { row7.CUST_NAME = null; } else { tmpContent_tMysqlInput_3 = rs_tMysqlInput_3.getString(3); if (tmpContent_tMysqlInput_3 != null) { row7.CUST_NAME = tmpContent_tMysqlInput_3; } else { row7.CUST_NAME = null; } } if (colQtyInRs_tMysqlInput_3 < 4) { row7.ENABLED = 0; } else { if (rs_tMysqlInput_3.getObject(4) != null) { row7.ENABLED = rs_tMysqlInput_3.getByte(4); } else { throw new RuntimeException("Null value in non-Nullable column"); } } /** * [tMysqlInput_3 begin ] stop */ /** * [tMysqlInput_3 main ] start */ currentComponent = "tMysqlInput_3"; tos_count_tMysqlInput_3++; /** * [tMysqlInput_3 main ] stop */ /** * [tMap_11 main ] start */ currentComponent = "tMap_11"; boolean hasCasePrimitiveKeyWithNull_tMap_11 = false; // ############################### // # Input tables (lookups) boolean rejectedInnerJoin_tMap_11 = false; boolean mainRowRejected_tMap_11 = false; // ///////////////////////////////////////////// // Starting Lookup Table "row8" // ///////////////////////////////////////////// boolean forceLooprow8 = false; row8Struct row8ObjectFromLookup = null; if (!rejectedInnerJoin_tMap_11) { // G_TM_M_020 hasCasePrimitiveKeyWithNull_tMap_11 = false; row8HashKey.CUST_UUID = row7.UUID; row8HashKey.hashCodeDirty = true; tHash_Lookup_row8.lookup(row8HashKey); if (!tHash_Lookup_row8.hasNext()) { // G_TM_M_090 rejectedInnerJoin_tMap_11 = true; } // G_TM_M_090 } // G_TM_M_020 if (tHash_Lookup_row8 != null && tHash_Lookup_row8.getCount(row8HashKey) > 1) { // G // 071 // System.out.println("WARNING: UNIQUE MATCH is configured for the lookup 'row8' and it contains more one result from keys : row8.CUST_UUID = '" // + row8HashKey.CUST_UUID + "'"); } // G 071 row8Struct row8 = null; row8Struct fromLookup_row8 = null; row8 = row8Default; if (tHash_Lookup_row8 != null && tHash_Lookup_row8.hasNext()) { // G 099 fromLookup_row8 = tHash_Lookup_row8.next(); } // G 099 if (fromLookup_row8 != null) { row8 = fromLookup_row8; } // ############################### { // start of Var scope // ############################### // # Vars tables Var__tMap_11__Struct Var = Var__tMap_11;// ############################### // ############################### // # Output tables custData = null; if (!rejectedInnerJoin_tMap_11) { // # Output table : 'custData' custData_tmp.CUST_NAME = row7.CUST_NAME; custData_tmp.DATA_SOURCE_ID = row8.ID; custData = custData_tmp; } // closing inner join bracket (2) // ############################### } // end of Var scope rejectedInnerJoin_tMap_11 = false; tos_count_tMap_11++; /** * [tMap_11 main ] stop */ // Start of branch "custData" if (custData != null) { /** * [tAdvancedHash_custData main ] start */ currentComponent = "tAdvancedHash_custData"; custDataStruct custData_HashRow = new custDataStruct(); custData_HashRow.CUST_NAME = custData.CUST_NAME; custData_HashRow.DATA_SOURCE_ID = custData.DATA_SOURCE_ID; tHash_Lookup_custData.put(custData_HashRow); tos_count_tAdvancedHash_custData++; /** * [tAdvancedHash_custData main ] stop */ } // End of branch "custData" /** * [tMysqlInput_3 end ] start */ currentComponent = "tMysqlInput_3"; } rs_tMysqlInput_3.close(); stmt_tMysqlInput_3.close(); conn_tMysqlInput_3.close(); globalMap.put("tMysqlInput_3_NB_LINE", nb_line_tMysqlInput_3); ok_Hash.put("tMysqlInput_3", true); end_Hash.put("tMysqlInput_3", System.currentTimeMillis()); /** * [tMysqlInput_3 end ] stop */ /** * [tMap_11 end ] start */ currentComponent = "tMap_11"; // ############################### // # Lookup hashes releasing if (tHash_Lookup_row8 != null) { tHash_Lookup_row8.endGet(); } globalMap.remove("tHash_Lookup_row8"); // ############################### ok_Hash.put("tMap_11", true); end_Hash.put("tMap_11", System.currentTimeMillis()); /** * [tMap_11 end ] stop */ /** * [tAdvancedHash_custData end ] start */ currentComponent = "tAdvancedHash_custData"; tHash_Lookup_custData.endPut(); ok_Hash.put("tAdvancedHash_custData", true); end_Hash.put("tAdvancedHash_custData", System.currentTimeMillis()); /** * [tAdvancedHash_custData end ] stop */ } // end the resume } catch (Exception e) { throw new TalendException(e, currentComponent, globalMap); } catch (java.lang.Error error) { throw new java.lang.Error(error); } finally { // free memory for "tMap_11" globalMap.put("tHash_Lookup_row8", null); } globalMap.put("tMysqlInput_3_SUBPROCESS_STATE", 1); }
From source file:com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance.java
/** * Restores sub-class data for the L2PcInstance, used to check the current class index for the character. * @param player the player//from w w w .j a v a 2 s . c o m * @return true, if successful */ private static boolean restoreSubClassData(final L2PcInstance player) { Connection con = null; try { con = L2DatabaseFactory.getInstance().getConnection(false); PreparedStatement statement = con.prepareStatement(RESTORE_CHAR_SUBCLASSES); statement.setInt(1, player.getObjectId()); ResultSet rset = statement.executeQuery(); while (rset.next()) { final SubClass subClass = new SubClass(); subClass.setClassId(rset.getInt("class_id")); subClass.setLevel(rset.getByte("level")); subClass.setExp(rset.getLong("exp")); subClass.setSp(rset.getInt("sp")); subClass.setClassIndex(rset.getInt("class_index")); // Enforce the correct indexing of _subClasses against their class indexes. player.getSubClasses().put(subClass.getClassIndex(), subClass); } DatabaseUtils.close(statement); DatabaseUtils.close(rset); rset = null; statement = null; } catch (final Exception e) { LOGGER.warn("Could not restore classes for " + player.getName() + ": " + e); e.printStackTrace(); } finally { CloseUtil.close(con); con = null; } return true; }
From source file:com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance.java
/** * Retrieve a L2PcInstance from the characters table of the database and add it in _allObjects of the L2world.<BR> * <BR>//from w ww. j av a2 s . c om * <B><U> Actions</U> :</B><BR> * <BR> * <li>Retrieve the L2PcInstance from the characters table of the database</li> <li>Add the L2PcInstance object in _allObjects</li> <li>Set the x,y,z position of the L2PcInstance and make it invisible</li> <li>Update the overloaded status of the L2PcInstance</li><BR> * <BR> * @param objectId Identifier of the object to initialized * @return The L2PcInstance loaded from the database */ private static L2PcInstance restore(final int objectId) { L2PcInstance player = null; double curHp = 0; double curCp = 0; double curMp = 0; Connection con = null; try { // Retrieve the L2PcInstance from the characters table of the database con = L2DatabaseFactory.getInstance().getConnection(false); final PreparedStatement statement = con.prepareStatement(RESTORE_CHARACTER); statement.setInt(1, objectId); final ResultSet rset = statement.executeQuery(); while (rset.next()) { final int activeClassId = rset.getInt("classid"); final boolean female = rset.getInt("sex") != 0; final L2PcTemplate template = CharTemplateTable.getInstance().getTemplate(activeClassId); PcAppearance app = new PcAppearance(rset.getByte("face"), rset.getByte("hairColor"), rset.getByte("hairStyle"), female); player = new L2PcInstance(objectId, template, rset.getString("account_name"), app); player.setName(rset.getString("char_name")); player._lastAccess = rset.getLong("lastAccess"); player.getStat().setExp(rset.getLong("exp")); player.setExpBeforeDeath(rset.getLong("expBeforeDeath")); player.getStat().setLevel(rset.getByte("level")); player.getStat().setSp(rset.getInt("sp")); player.setWantsPeace(rset.getInt("wantspeace")); player.setHeading(rset.getInt("heading")); player.setKarma(rset.getInt("karma")); player.setPvpKills(rset.getInt("pvpkills")); player.setPkKills(rset.getInt("pkkills")); player.setOnlineTime(rset.getLong("onlinetime")); player.setNewbie(rset.getInt("newbie") == 1); player.setNoble(rset.getInt("nobless") == 1); player.setClanJoinExpiryTime(rset.getLong("clan_join_expiry_time")); player.setFirstLog(rset.getInt("first_log")); player.pcBangPoint = rset.getInt("pc_point"); app = null; if (player.getClanJoinExpiryTime() < System.currentTimeMillis()) { player.setClanJoinExpiryTime(0); } player.setClanCreateExpiryTime(rset.getLong("clan_create_expiry_time")); if (player.getClanCreateExpiryTime() < System.currentTimeMillis()) { player.setClanCreateExpiryTime(0); } final int clanId = rset.getInt("clanid"); player.setPowerGrade((int) rset.getLong("power_grade")); player.setPledgeType(rset.getInt("subpledge")); player.setLastRecomUpdate(rset.getLong("last_recom_date")); // player.setApprentice(rset.getInt("apprentice")); if (clanId > 0) { player.setClan(ClanTable.getInstance().getClan(clanId)); } if (player.getClan() != null) { if (player.getClan().getLeaderId() != player.getObjectId()) { if (player.getPowerGrade() == 0) { player.setPowerGrade(5); } player.setClanPrivileges(player.getClan().getRankPrivs(player.getPowerGrade())); } else { player.setClanPrivileges(L2Clan.CP_ALL); player.setPowerGrade(1); } } else { player.setClanPrivileges(L2Clan.CP_NOTHING); } player.setDeleteTimer(rset.getLong("deletetime")); player.setTitle(rset.getString("title")); player.setAccessLevel(rset.getInt("accesslevel")); player.setFistsWeaponItem(player.findFistsWeaponItem(activeClassId)); player.setUptime(System.currentTimeMillis()); curHp = rset.getDouble("curHp"); curCp = rset.getDouble("curCp"); curMp = rset.getDouble("curMp"); /* * player.setCurrentHp(rset.getDouble("curHp")); player.setCurrentCp(rset.getDouble("curCp")); player.setCurrentMp(rset.getDouble("curMp")); */ // Check recs player.checkRecom(rset.getInt("rec_have"), rset.getInt("rec_left")); player._classIndex = 0; try { player.setBaseClass(rset.getInt("base_class")); } catch (final Exception e) { if (Config.ENABLE_ALL_EXCEPTIONS) e.printStackTrace(); player.setBaseClass(activeClassId); } // Restore Subclass Data (cannot be done earlier in function) if (restoreSubClassData(player)) { if (activeClassId != player.getBaseClass()) { for (final SubClass subClass : player.getSubClasses().values()) if (subClass.getClassId() == activeClassId) { player._classIndex = subClass.getClassIndex(); } } } if (player.getClassIndex() == 0 && activeClassId != player.getBaseClass()) { // Subclass in use but doesn't exist in DB - // a possible restart-while-modifysubclass cheat has been attempted. // Switching to use base class player.setClassId(player.getBaseClass()); LOGGER.warn("Player " + player.getName() + " reverted to base class. Possibly has tried a relogin exploit while subclassing."); } else { player._activeClass = activeClassId; } player.setApprentice(rset.getInt("apprentice")); player.setSponsor(rset.getInt("sponsor")); player.setLvlJoinedAcademy(rset.getInt("lvl_joined_academy")); player.setIsIn7sDungeon(rset.getInt("isin7sdungeon") == 1 ? true : false); player.setPunishLevel(rset.getInt("punish_level")); if (player.getPunishLevel() != PunishLevel.NONE) player.setPunishTimer(rset.getLong("punish_timer")); else player.setPunishTimer(0); /* * player.setInJail(rset.getInt("in_jail") == 1 ? true : false); if(player.isInJail()) { player.setJailTimer(rset.getLong("jail_timer")); } else { player.setJailTimer(0); } player.setChatBanTimer(rset.getLong("banchat_time")); player.updateChatBanState(); */ try { player.getAppearance().setNameColor(Integer.decode( new StringBuilder().append("0x").append(rset.getString("name_color")).toString()) .intValue()); player.getAppearance().setTitleColor(Integer.decode( new StringBuilder().append("0x").append(rset.getString("title_color")).toString()) .intValue()); } catch (final Exception e) { if (Config.ENABLE_ALL_EXCEPTIONS) e.printStackTrace(); // leave them as default } CursedWeaponsManager.getInstance().checkPlayer(player); player.setAllianceWithVarkaKetra(rset.getInt("varka_ketra_ally")); player.setDeathPenaltyBuffLevel(rset.getInt("death_penalty_level")); player.setAio(rset.getInt("aio") == 1 ? true : false); player.setAioEndTime(rset.getLong("aio_end")); // Add the L2PcInstance object in _allObjects // L2World.getInstance().storeObject(player); // Set the x,y,z position of the L2PcInstance and make it invisible player.setXYZInvisible(rset.getInt("x"), rset.getInt("y"), rset.getInt("z")); // Retrieve the name and ID of the other characters assigned to this account. PreparedStatement stmt = con.prepareStatement( "SELECT obj_Id, char_name FROM characters WHERE account_name=? AND obj_Id<>?"); stmt.setString(1, player._accountName); stmt.setInt(2, objectId); ResultSet chars = stmt.executeQuery(); while (chars.next()) { final Integer charId = chars.getInt("obj_Id"); final String charName = chars.getString("char_name"); player._chars.put(charId, charName); } chars.close(); stmt.close(); chars = null; stmt = null; break; } DatabaseUtils.close(rset); DatabaseUtils.close(statement); if (player == null) { // TODO: Log this! return null; } // Retrieve from the database all secondary data of this L2PcInstance // and reward expertise/lucky skills if necessary. // Note that Clan, Noblesse and Hero skills are given separately and not here. player.restoreCharData(); // reward skill restore mode in order to avoid duplicate storage of already stored skills player.rewardSkills(true); // Restore pet if exists in the world player.setPet(L2World.getInstance().getPet(player.getObjectId())); if (player.getPet() != null) { player.getPet().setOwner(player); } // Update the overloaded status of the L2PcInstance player.refreshOverloaded(); player.restoreFriendList(); } catch (final Exception e) { LOGGER.error("Could not restore char data", e); e.printStackTrace(); } finally { CloseUtil.close(con); } if (player != null) { player.fireEvent(EventType.LOAD.name, (Object[]) null); try { Thread.sleep(100); } catch (final InterruptedException e) { e.printStackTrace(); } // once restored all the skill status, update current CP, MP and HP player.setCurrentHpDirect(curHp); player.setCurrentCpDirect(curCp); player.setCurrentMpDirect(curMp); // player.setCurrentCp(curCp); // player.setCurrentMp(curMp); } return player; }
From source file:talonetl.getproperties_1_2.getProperties.java
public void tMysqlInput_3Process(final java.util.Map<String, Object> globalMap) throws TalendException { globalMap.put("tMysqlInput_3_SUBPROCESS_STATE", 0); final boolean execStat = this.execStat; String iterateId = ""; int iterateLoop = 0; String currentComponent = ""; try {/*from w w w. j a va 2s.c o m*/ String currentMethodName = new Exception().getStackTrace()[0].getMethodName(); boolean resumeIt = currentMethodName.equals(resumeEntryMethodName); if (resumeEntryMethodName == null || resumeIt || globalResumeTicket) {// start // the // resume globalResumeTicket = true; tMysqlInput_4Process(globalMap); row7Struct row7 = new row7Struct(); custDataStruct custData = new custDataStruct(); /** * [tAdvancedHash_custData begin ] start */ ok_Hash.put("tAdvancedHash_custData", false); start_Hash.put("tAdvancedHash_custData", System.currentTimeMillis()); currentComponent = "tAdvancedHash_custData"; int tos_count_tAdvancedHash_custData = 0; // connection name:custData // source node:tMap_11 - inputs:(row8,row7) // outputs:(custData,custData) | target // node:tAdvancedHash_custData - inputs:(custData) outputs:() // linked node: tMap_4 - inputs:(propertyData,custData) // outputs:(loadData) org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE matchingModeEnum_custData = org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE.UNIQUE_MATCH; org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<custDataStruct> tHash_Lookup_custData = org.talend.designer.components.lookup.memory.AdvancedMemoryLookup .<custDataStruct>getLookup(matchingModeEnum_custData); globalMap.put("tHash_Lookup_custData", tHash_Lookup_custData); /** * [tAdvancedHash_custData begin ] stop */ /** * [tMap_11 begin ] start */ ok_Hash.put("tMap_11", false); start_Hash.put("tMap_11", System.currentTimeMillis()); currentComponent = "tMap_11"; int tos_count_tMap_11 = 0; // ############################### // # Lookup's keys initialization org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row8Struct> tHash_Lookup_row8 = (org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row8Struct>) ((org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row8Struct>) globalMap .get("tHash_Lookup_row8")); row8Struct row8HashKey = new row8Struct(); row8Struct row8Default = new row8Struct(); // ############################### // ############################### // # Vars initialization class Var__tMap_11__Struct { } Var__tMap_11__Struct Var__tMap_11 = new Var__tMap_11__Struct(); // ############################### // ############################### // # Outputs initialization custDataStruct custData_tmp = new custDataStruct(); // ############################### /** * [tMap_11 begin ] stop */ /** * [tMysqlInput_3 begin ] start */ ok_Hash.put("tMysqlInput_3", false); start_Hash.put("tMysqlInput_3", System.currentTimeMillis()); currentComponent = "tMysqlInput_3"; int tos_count_tMysqlInput_3 = 0; java.util.Calendar calendar_tMysqlInput_3 = java.util.Calendar.getInstance(); calendar_tMysqlInput_3.set(0, 0, 0, 0, 0, 0); java.util.Date year0_tMysqlInput_3 = calendar_tMysqlInput_3.getTime(); int nb_line_tMysqlInput_3 = 0; java.sql.Connection conn_tMysqlInput_3 = null; java.util.Map<String, routines.system.TalendDataSource> dataSources_tMysqlInput_3 = (java.util.Map<String, routines.system.TalendDataSource>) globalMap .get(KEY_DB_DATASOURCES); if (null != dataSources_tMysqlInput_3) { conn_tMysqlInput_3 = dataSources_tMysqlInput_3.get("").getConnection(); } else { java.lang.Class.forName("org.gjt.mm.mysql.Driver"); String url_tMysqlInput_3 = "jdbc:mysql://" + context.talon_Server + ":" + context.talon_Port + "/" + context.talon_Database + "?" + context.talon_AdditionalParams; String dbUser_tMysqlInput_3 = context.talon_Login; String dbPwd_tMysqlInput_3 = context.talon_Password; conn_tMysqlInput_3 = java.sql.DriverManager.getConnection(url_tMysqlInput_3, dbUser_tMysqlInput_3, dbPwd_tMysqlInput_3); } java.sql.Statement stmt_tMysqlInput_3 = conn_tMysqlInput_3.createStatement(); String dbquery_tMysqlInput_3 = "SELECT `CUSTOMER`.`ID`, `CUSTOMER`.`UUID`, `CUSTOMER`.`CUST_NAME`, `CUSTOMER`.`ENABLED` FROM `CUSTOMER` "; globalMap.put("tMysqlInput_3_QUERY", dbquery_tMysqlInput_3); java.sql.ResultSet rs_tMysqlInput_3 = stmt_tMysqlInput_3.executeQuery(dbquery_tMysqlInput_3); java.sql.ResultSetMetaData rsmd_tMysqlInput_3 = rs_tMysqlInput_3.getMetaData(); int colQtyInRs_tMysqlInput_3 = rsmd_tMysqlInput_3.getColumnCount(); String tmpContent_tMysqlInput_3 = null; while (rs_tMysqlInput_3.next()) { nb_line_tMysqlInput_3++; if (colQtyInRs_tMysqlInput_3 < 1) { row7.ID = 0; } else { if (rs_tMysqlInput_3.getObject(1) != null) { row7.ID = rs_tMysqlInput_3.getInt(1); } else { throw new RuntimeException("Null value in non-Nullable column"); } } if (colQtyInRs_tMysqlInput_3 < 2) { row7.UUID = null; } else { tmpContent_tMysqlInput_3 = rs_tMysqlInput_3.getString(2); if (tmpContent_tMysqlInput_3 != null) { row7.UUID = tmpContent_tMysqlInput_3; } else { row7.UUID = null; } } if (colQtyInRs_tMysqlInput_3 < 3) { row7.CUST_NAME = null; } else { tmpContent_tMysqlInput_3 = rs_tMysqlInput_3.getString(3); if (tmpContent_tMysqlInput_3 != null) { row7.CUST_NAME = tmpContent_tMysqlInput_3; } else { row7.CUST_NAME = null; } } if (colQtyInRs_tMysqlInput_3 < 4) { row7.ENABLED = 0; } else { if (rs_tMysqlInput_3.getObject(4) != null) { row7.ENABLED = rs_tMysqlInput_3.getByte(4); } else { throw new RuntimeException("Null value in non-Nullable column"); } } /** * [tMysqlInput_3 begin ] stop */ /** * [tMysqlInput_3 main ] start */ currentComponent = "tMysqlInput_3"; tos_count_tMysqlInput_3++; /** * [tMysqlInput_3 main ] stop */ /** * [tMap_11 main ] start */ currentComponent = "tMap_11"; boolean hasCasePrimitiveKeyWithNull_tMap_11 = false; // ############################### // # Input tables (lookups) boolean rejectedInnerJoin_tMap_11 = false; boolean mainRowRejected_tMap_11 = false; // ///////////////////////////////////////////// // Starting Lookup Table "row8" // ///////////////////////////////////////////// boolean forceLooprow8 = false; row8Struct row8ObjectFromLookup = null; if (!rejectedInnerJoin_tMap_11) { // G_TM_M_020 hasCasePrimitiveKeyWithNull_tMap_11 = false; row8HashKey.CUST_UUID = row7.UUID; row8HashKey.hashCodeDirty = true; tHash_Lookup_row8.lookup(row8HashKey); if (!tHash_Lookup_row8.hasNext()) { // G_TM_M_090 rejectedInnerJoin_tMap_11 = true; } // G_TM_M_090 } // G_TM_M_020 if (tHash_Lookup_row8 != null && tHash_Lookup_row8.getCount(row8HashKey) > 1) { // G // 071 // System.out.println("WARNING: UNIQUE MATCH is configured for the lookup 'row8' and it contains more one result from keys : row8.CUST_UUID = '" // + row8HashKey.CUST_UUID + "'"); } // G 071 row8Struct row8 = null; row8Struct fromLookup_row8 = null; row8 = row8Default; if (tHash_Lookup_row8 != null && tHash_Lookup_row8.hasNext()) { // G 099 fromLookup_row8 = tHash_Lookup_row8.next(); } // G 099 if (fromLookup_row8 != null) { row8 = fromLookup_row8; } // ############################### { // start of Var scope // ############################### // # Vars tables Var__tMap_11__Struct Var = Var__tMap_11;// ############################### // ############################### // # Output tables custData = null; if (!rejectedInnerJoin_tMap_11) { // # Output table : 'custData' custData_tmp.CUST_NAME = row7.CUST_NAME; custData_tmp.DATA_SOURCE_ID = row8.ID; custData = custData_tmp; } // closing inner join bracket (2) // ############################### } // end of Var scope rejectedInnerJoin_tMap_11 = false; tos_count_tMap_11++; /** * [tMap_11 main ] stop */ // Start of branch "custData" if (custData != null) { /** * [tAdvancedHash_custData main ] start */ currentComponent = "tAdvancedHash_custData"; custDataStruct custData_HashRow = new custDataStruct(); custData_HashRow.CUST_NAME = custData.CUST_NAME; custData_HashRow.DATA_SOURCE_ID = custData.DATA_SOURCE_ID; tHash_Lookup_custData.put(custData_HashRow); tos_count_tAdvancedHash_custData++; /** * [tAdvancedHash_custData main ] stop */ } // End of branch "custData" /** * [tMysqlInput_3 end ] start */ currentComponent = "tMysqlInput_3"; } rs_tMysqlInput_3.close(); stmt_tMysqlInput_3.close(); conn_tMysqlInput_3.close(); globalMap.put("tMysqlInput_3_NB_LINE", nb_line_tMysqlInput_3); ok_Hash.put("tMysqlInput_3", true); end_Hash.put("tMysqlInput_3", System.currentTimeMillis()); /** * [tMysqlInput_3 end ] stop */ /** * [tMap_11 end ] start */ currentComponent = "tMap_11"; // ############################### // # Lookup hashes releasing if (tHash_Lookup_row8 != null) { tHash_Lookup_row8.endGet(); } globalMap.remove("tHash_Lookup_row8"); // ############################### ok_Hash.put("tMap_11", true); end_Hash.put("tMap_11", System.currentTimeMillis()); /** * [tMap_11 end ] stop */ /** * [tAdvancedHash_custData end ] start */ currentComponent = "tAdvancedHash_custData"; tHash_Lookup_custData.endPut(); ok_Hash.put("tAdvancedHash_custData", true); end_Hash.put("tAdvancedHash_custData", System.currentTimeMillis()); /** * [tAdvancedHash_custData end ] stop */ } // end the resume } catch (Exception e) { throw new TalendException(e, currentComponent, globalMap); } catch (java.lang.Error error) { throw new java.lang.Error(error); } finally { // free memory for "tMap_11" globalMap.put("tHash_Lookup_row8", null); } globalMap.put("tMysqlInput_3_SUBPROCESS_STATE", 1); }
From source file:talonetl.getproperties_1_3.getProperties.java
public void tMysqlInput_3Process(final java.util.Map<String, Object> globalMap) throws TalendException { globalMap.put("tMysqlInput_3_SUBPROCESS_STATE", 0); final boolean execStat = this.execStat; String iterateId = ""; int iterateLoop = 0; String currentComponent = ""; try {/*from w ww. j av a2 s . c om*/ String currentMethodName = new Exception().getStackTrace()[0].getMethodName(); boolean resumeIt = currentMethodName.equals(resumeEntryMethodName); if (resumeEntryMethodName == null || resumeIt || globalResumeTicket) {// start // the // resume globalResumeTicket = true; tMysqlInput_4Process(globalMap); row7Struct row7 = new row7Struct(); custDataStruct custData = new custDataStruct(); /** * [tAdvancedHash_custData begin ] start */ ok_Hash.put("tAdvancedHash_custData", false); start_Hash.put("tAdvancedHash_custData", System.currentTimeMillis()); currentComponent = "tAdvancedHash_custData"; int tos_count_tAdvancedHash_custData = 0; // connection name:custData // source node:tMap_11 - inputs:(row8,row7) // outputs:(custData,custData) | target // node:tAdvancedHash_custData - inputs:(custData) outputs:() // linked node: tMap_4 - inputs:(propertyData,custData) // outputs:(loadData) org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE matchingModeEnum_custData = org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE.UNIQUE_MATCH; org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<custDataStruct> tHash_Lookup_custData = org.talend.designer.components.lookup.memory.AdvancedMemoryLookup .<custDataStruct>getLookup(matchingModeEnum_custData); globalMap.put("tHash_Lookup_custData", tHash_Lookup_custData); /** * [tAdvancedHash_custData begin ] stop */ /** * [tMap_11 begin ] start */ ok_Hash.put("tMap_11", false); start_Hash.put("tMap_11", System.currentTimeMillis()); currentComponent = "tMap_11"; int tos_count_tMap_11 = 0; // ############################### // # Lookup's keys initialization org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row8Struct> tHash_Lookup_row8 = (org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row8Struct>) ((org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row8Struct>) globalMap .get("tHash_Lookup_row8")); row8Struct row8HashKey = new row8Struct(); row8Struct row8Default = new row8Struct(); // ############################### // ############################### // # Vars initialization class Var__tMap_11__Struct { } Var__tMap_11__Struct Var__tMap_11 = new Var__tMap_11__Struct(); // ############################### // ############################### // # Outputs initialization custDataStruct custData_tmp = new custDataStruct(); // ############################### /** * [tMap_11 begin ] stop */ /** * [tMysqlInput_3 begin ] start */ ok_Hash.put("tMysqlInput_3", false); start_Hash.put("tMysqlInput_3", System.currentTimeMillis()); currentComponent = "tMysqlInput_3"; int tos_count_tMysqlInput_3 = 0; java.util.Calendar calendar_tMysqlInput_3 = java.util.Calendar.getInstance(); calendar_tMysqlInput_3.set(0, 0, 0, 0, 0, 0); java.util.Date year0_tMysqlInput_3 = calendar_tMysqlInput_3.getTime(); int nb_line_tMysqlInput_3 = 0; java.sql.Connection conn_tMysqlInput_3 = null; java.util.Map<String, routines.system.TalendDataSource> dataSources_tMysqlInput_3 = (java.util.Map<String, routines.system.TalendDataSource>) globalMap .get(KEY_DB_DATASOURCES); if (null != dataSources_tMysqlInput_3) { conn_tMysqlInput_3 = dataSources_tMysqlInput_3.get("").getConnection(); } else { java.lang.Class.forName("org.gjt.mm.mysql.Driver"); String url_tMysqlInput_3 = "jdbc:mysql://" + context.talon_Server + ":" + context.talon_Port + "/" + context.talon_Database + "?" + context.talon_AdditionalParams; String dbUser_tMysqlInput_3 = context.talon_Login; String dbPwd_tMysqlInput_3 = context.talon_Password; conn_tMysqlInput_3 = java.sql.DriverManager.getConnection(url_tMysqlInput_3, dbUser_tMysqlInput_3, dbPwd_tMysqlInput_3); } java.sql.Statement stmt_tMysqlInput_3 = conn_tMysqlInput_3.createStatement(); String dbquery_tMysqlInput_3 = "SELECT `CUSTOMER`.`ID`, `CUSTOMER`.`UUID`, `CUSTOMER`.`CUST_NAME`, `CUSTOMER`.`ENABLED` FROM `CUSTOMER` "; globalMap.put("tMysqlInput_3_QUERY", dbquery_tMysqlInput_3); java.sql.ResultSet rs_tMysqlInput_3 = stmt_tMysqlInput_3.executeQuery(dbquery_tMysqlInput_3); java.sql.ResultSetMetaData rsmd_tMysqlInput_3 = rs_tMysqlInput_3.getMetaData(); int colQtyInRs_tMysqlInput_3 = rsmd_tMysqlInput_3.getColumnCount(); String tmpContent_tMysqlInput_3 = null; while (rs_tMysqlInput_3.next()) { nb_line_tMysqlInput_3++; if (colQtyInRs_tMysqlInput_3 < 1) { row7.ID = 0; } else { if (rs_tMysqlInput_3.getObject(1) != null) { row7.ID = rs_tMysqlInput_3.getInt(1); } else { throw new RuntimeException("Null value in non-Nullable column"); } } if (colQtyInRs_tMysqlInput_3 < 2) { row7.UUID = null; } else { tmpContent_tMysqlInput_3 = rs_tMysqlInput_3.getString(2); if (tmpContent_tMysqlInput_3 != null) { row7.UUID = tmpContent_tMysqlInput_3; } else { row7.UUID = null; } } if (colQtyInRs_tMysqlInput_3 < 3) { row7.CUST_NAME = null; } else { tmpContent_tMysqlInput_3 = rs_tMysqlInput_3.getString(3); if (tmpContent_tMysqlInput_3 != null) { row7.CUST_NAME = tmpContent_tMysqlInput_3; } else { row7.CUST_NAME = null; } } if (colQtyInRs_tMysqlInput_3 < 4) { row7.ENABLED = 0; } else { if (rs_tMysqlInput_3.getObject(4) != null) { row7.ENABLED = rs_tMysqlInput_3.getByte(4); } else { throw new RuntimeException("Null value in non-Nullable column"); } } /** * [tMysqlInput_3 begin ] stop */ /** * [tMysqlInput_3 main ] start */ currentComponent = "tMysqlInput_3"; tos_count_tMysqlInput_3++; /** * [tMysqlInput_3 main ] stop */ /** * [tMap_11 main ] start */ currentComponent = "tMap_11"; boolean hasCasePrimitiveKeyWithNull_tMap_11 = false; // ############################### // # Input tables (lookups) boolean rejectedInnerJoin_tMap_11 = false; boolean mainRowRejected_tMap_11 = false; // ///////////////////////////////////////////// // Starting Lookup Table "row8" // ///////////////////////////////////////////// boolean forceLooprow8 = false; row8Struct row8ObjectFromLookup = null; if (!rejectedInnerJoin_tMap_11) { // G_TM_M_020 hasCasePrimitiveKeyWithNull_tMap_11 = false; row8HashKey.CUST_UUID = row7.UUID; row8HashKey.hashCodeDirty = true; tHash_Lookup_row8.lookup(row8HashKey); if (!tHash_Lookup_row8.hasNext()) { // G_TM_M_090 rejectedInnerJoin_tMap_11 = true; } // G_TM_M_090 } // G_TM_M_020 if (tHash_Lookup_row8 != null && tHash_Lookup_row8.getCount(row8HashKey) > 1) { // G // 071 // System.out.println("WARNING: UNIQUE MATCH is configured for the lookup 'row8' and it contains more one result from keys : row8.CUST_UUID = '" // + row8HashKey.CUST_UUID + "'"); } // G 071 row8Struct row8 = null; row8Struct fromLookup_row8 = null; row8 = row8Default; if (tHash_Lookup_row8 != null && tHash_Lookup_row8.hasNext()) { // G 099 fromLookup_row8 = tHash_Lookup_row8.next(); } // G 099 if (fromLookup_row8 != null) { row8 = fromLookup_row8; } // ############################### { // start of Var scope // ############################### // # Vars tables Var__tMap_11__Struct Var = Var__tMap_11;// ############################### // ############################### // # Output tables custData = null; if (!rejectedInnerJoin_tMap_11) { // # Output table : 'custData' custData_tmp.CUST_NAME = row7.CUST_NAME; custData_tmp.DATA_SOURCE_ID = row8.ID; custData_tmp.CUST_UUID = row8.CUST_UUID; custData = custData_tmp; } // closing inner join bracket (2) // ############################### } // end of Var scope rejectedInnerJoin_tMap_11 = false; tos_count_tMap_11++; /** * [tMap_11 main ] stop */ // Start of branch "custData" if (custData != null) { /** * [tAdvancedHash_custData main ] start */ currentComponent = "tAdvancedHash_custData"; custDataStruct custData_HashRow = new custDataStruct(); custData_HashRow.CUST_NAME = custData.CUST_NAME; custData_HashRow.DATA_SOURCE_ID = custData.DATA_SOURCE_ID; custData_HashRow.CUST_UUID = custData.CUST_UUID; tHash_Lookup_custData.put(custData_HashRow); tos_count_tAdvancedHash_custData++; /** * [tAdvancedHash_custData main ] stop */ } // End of branch "custData" /** * [tMysqlInput_3 end ] start */ currentComponent = "tMysqlInput_3"; } rs_tMysqlInput_3.close(); stmt_tMysqlInput_3.close(); conn_tMysqlInput_3.close(); globalMap.put("tMysqlInput_3_NB_LINE", nb_line_tMysqlInput_3); ok_Hash.put("tMysqlInput_3", true); end_Hash.put("tMysqlInput_3", System.currentTimeMillis()); /** * [tMysqlInput_3 end ] stop */ /** * [tMap_11 end ] start */ currentComponent = "tMap_11"; // ############################### // # Lookup hashes releasing if (tHash_Lookup_row8 != null) { tHash_Lookup_row8.endGet(); } globalMap.remove("tHash_Lookup_row8"); // ############################### ok_Hash.put("tMap_11", true); end_Hash.put("tMap_11", System.currentTimeMillis()); /** * [tMap_11 end ] stop */ /** * [tAdvancedHash_custData end ] start */ currentComponent = "tAdvancedHash_custData"; tHash_Lookup_custData.endPut(); ok_Hash.put("tAdvancedHash_custData", true); end_Hash.put("tAdvancedHash_custData", System.currentTimeMillis()); /** * [tAdvancedHash_custData end ] stop */ } // end the resume } catch (Exception e) { throw new TalendException(e, currentComponent, globalMap); } catch (java.lang.Error error) { throw new java.lang.Error(error); } finally { // free memory for "tMap_11" globalMap.put("tHash_Lookup_row8", null); } globalMap.put("tMysqlInput_3_SUBPROCESS_STATE", 1); }