List of usage examples for java.sql ResultSet getFloat
float getFloat(String columnLabel) throws SQLException;
ResultSet
object as a float
in the Java programming language. From source file:talonetl.getpropfinacials_0_3.getPropFinacials.java
public void tMysqlInput_1Process(final java.util.Map<String, Object> globalMap) throws TalendException { globalMap.put("tMysqlInput_1_SUBPROCESS_STATE", 0); final boolean execStat = this.execStat; String iterateId = ""; int iterateLoop = 0; String currentComponent = ""; try {/*from www . j ava 2 s.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; row11Struct row11 = new row11Struct(); /** * [tAdvancedHash_row11 begin ] start */ ok_Hash.put("tAdvancedHash_row11", false); start_Hash.put("tAdvancedHash_row11", System.currentTimeMillis()); currentComponent = "tAdvancedHash_row11"; int tos_count_tAdvancedHash_row11 = 0; // connection name:row11 // source node:tMysqlInput_1 - inputs:(after_tFileInputXML_1) // outputs:(row11,row11) | target node:tAdvancedHash_row11 - // inputs:(row11) outputs:() // linked node: tMap_1 - inputs:(row1,row11) // outputs:(financed_net_yield_1__c,monthly_cash_flow_with_financing_2__c,financed_net_yield_2__c,monthly_cash_flow_with_financing_1__c,interest_rate_1__c,interest_rate_2__c,price_per_ft_c,noi_with_financing_1__c,noi_with_financing_2__c,noi__c,monthly_cash_flow__c,est_replacement_cost__c,est_replacement_cost_per_sq_ft__c,cash_net_yield__c,down_payment_1__c,down_payment_2__c,interest_payment_1__c,yearly_interest_payment_1__c,monthly_interest_payment_2__c,est_of_market_value__c,est_value_per_rent_multiplier__c,annual_rents__c,monthlyrent__c,monthly_taxes__c,taxes__c) org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE matchingModeEnum_row11 = org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE.UNIQUE_MATCH; org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row11Struct> tHash_Lookup_row11 = org.talend.designer.components.lookup.memory.AdvancedMemoryLookup .<row11Struct>getLookup(matchingModeEnum_row11); globalMap.put("tHash_Lookup_row11", tHash_Lookup_row11); /** * [tAdvancedHash_row11 begin ] stop */ /** * [tMysqlInput_1 begin ] start */ ok_Hash.put("tMysqlInput_1", false); start_Hash.put("tMysqlInput_1", System.currentTimeMillis()); currentComponent = "tMysqlInput_1"; int tos_count_tMysqlInput_1 = 0; java.util.Calendar calendar_tMysqlInput_1 = java.util.Calendar.getInstance(); calendar_tMysqlInput_1.set(0, 0, 0, 0, 0, 0); java.util.Date year0_tMysqlInput_1 = calendar_tMysqlInput_1.getTime(); int nb_line_tMysqlInput_1 = 0; java.sql.Connection conn_tMysqlInput_1 = null; java.util.Map<String, routines.system.TalendDataSource> dataSources_tMysqlInput_1 = (java.util.Map<String, routines.system.TalendDataSource>) globalMap .get(KEY_DB_DATASOURCES); if (null != dataSources_tMysqlInput_1) { conn_tMysqlInput_1 = dataSources_tMysqlInput_1.get("").getConnection(); } else { java.lang.Class.forName("org.gjt.mm.mysql.Driver"); String url_tMysqlInput_1 = "jdbc:mysql://" + context.talon_Server + ":" + context.talon_Port + "/" + context.talon_Database + "?" + context.talon_AdditionalParams; String dbUser_tMysqlInput_1 = context.talon_Login; String dbPwd_tMysqlInput_1 = context.talon_Password; conn_tMysqlInput_1 = java.sql.DriverManager.getConnection(url_tMysqlInput_1, dbUser_tMysqlInput_1, dbPwd_tMysqlInput_1); } java.sql.Statement stmt_tMysqlInput_1 = conn_tMysqlInput_1.createStatement(); String dbquery_tMysqlInput_1 = "SELECT `PROPERTY_DATA`.`ID`, `PROPERTY_DATA`.`UUID`, `PROPERTY_DATA`.`PROP_NAME`, `PROPERTY_DATA`.`PRICE`, `PROPERTY_DATA`.`SQFT`, `PROPERTY_DATA`.`DESCRIPTION`, `PROPERTY_DATA`.`NUM_BEDS`, `PROPERTY_DATA`.`NUM_BATHS`, `PROPERTY_DATA`.`TYPE`, `PROPERTY_DATA`.`STATUS`, `PROPERTY_DATA`.`ZIP_CODE`, `PROPERTY_DATA`.`DATA_SOURCE_ID` FROM `PROPERTY_DATA`"; globalMap.put("tMysqlInput_1_QUERY", dbquery_tMysqlInput_1); java.sql.ResultSet rs_tMysqlInput_1 = stmt_tMysqlInput_1.executeQuery(dbquery_tMysqlInput_1); java.sql.ResultSetMetaData rsmd_tMysqlInput_1 = rs_tMysqlInput_1.getMetaData(); int colQtyInRs_tMysqlInput_1 = rsmd_tMysqlInput_1.getColumnCount(); String tmpContent_tMysqlInput_1 = null; while (rs_tMysqlInput_1.next()) { nb_line_tMysqlInput_1++; if (colQtyInRs_tMysqlInput_1 < 1) { row11.ID = 0; } else { if (rs_tMysqlInput_1.getObject(1) != null) { row11.ID = rs_tMysqlInput_1.getInt(1); } else { throw new RuntimeException("Null value in non-Nullable column"); } } if (colQtyInRs_tMysqlInput_1 < 2) { row11.UUID = null; } else { tmpContent_tMysqlInput_1 = rs_tMysqlInput_1.getString(2); if (tmpContent_tMysqlInput_1 != null) { row11.UUID = tmpContent_tMysqlInput_1; } else { row11.UUID = null; } } if (colQtyInRs_tMysqlInput_1 < 3) { row11.PROP_NAME = null; } else { tmpContent_tMysqlInput_1 = rs_tMysqlInput_1.getString(3); if (tmpContent_tMysqlInput_1 != null) { row11.PROP_NAME = tmpContent_tMysqlInput_1; } else { row11.PROP_NAME = null; } } if (colQtyInRs_tMysqlInput_1 < 4) { row11.PRICE = 0; } else { if (rs_tMysqlInput_1.getObject(4) != null) { row11.PRICE = rs_tMysqlInput_1.getFloat(4); } else { throw new RuntimeException("Null value in non-Nullable column"); } } if (colQtyInRs_tMysqlInput_1 < 5) { row11.SQFT = 0; } else { if (rs_tMysqlInput_1.getObject(5) != null) { row11.SQFT = rs_tMysqlInput_1.getFloat(5); } else { throw new RuntimeException("Null value in non-Nullable column"); } } if (colQtyInRs_tMysqlInput_1 < 6) { row11.DESCRIPTION = null; } else { tmpContent_tMysqlInput_1 = rs_tMysqlInput_1.getString(6); if (tmpContent_tMysqlInput_1 != null) { row11.DESCRIPTION = tmpContent_tMysqlInput_1; } else { row11.DESCRIPTION = null; } } if (colQtyInRs_tMysqlInput_1 < 7) { row11.NUM_BEDS = 0; } else { if (rs_tMysqlInput_1.getObject(7) != null) { row11.NUM_BEDS = rs_tMysqlInput_1.getFloat(7); } else { throw new RuntimeException("Null value in non-Nullable column"); } } if (colQtyInRs_tMysqlInput_1 < 8) { row11.NUM_BATHS = 0; } else { if (rs_tMysqlInput_1.getObject(8) != null) { row11.NUM_BATHS = rs_tMysqlInput_1.getFloat(8); } else { throw new RuntimeException("Null value in non-Nullable column"); } } if (colQtyInRs_tMysqlInput_1 < 9) { row11.TYPE = null; } else { tmpContent_tMysqlInput_1 = rs_tMysqlInput_1.getString(9); if (tmpContent_tMysqlInput_1 != null) { row11.TYPE = tmpContent_tMysqlInput_1; } else { row11.TYPE = null; } } if (colQtyInRs_tMysqlInput_1 < 10) { row11.STATUS = null; } else { tmpContent_tMysqlInput_1 = rs_tMysqlInput_1.getString(10); if (tmpContent_tMysqlInput_1 != null) { row11.STATUS = tmpContent_tMysqlInput_1; } else { row11.STATUS = null; } } if (colQtyInRs_tMysqlInput_1 < 11) { row11.DATA_SOURCE_ID = 0; } else { if (rs_tMysqlInput_1.getObject(11) != null) { row11.DATA_SOURCE_ID = rs_tMysqlInput_1.getInt(11); } else { throw new RuntimeException("Null value in non-Nullable column"); } } if (colQtyInRs_tMysqlInput_1 < 12) { row11.ZIP_CODE = 0; } else { if (rs_tMysqlInput_1.getObject(12) != null) { row11.ZIP_CODE = rs_tMysqlInput_1.getInt(12); } else { throw new RuntimeException("Null value in non-Nullable column"); } } /** * [tMysqlInput_1 begin ] stop */ /** * [tMysqlInput_1 main ] start */ currentComponent = "tMysqlInput_1"; tos_count_tMysqlInput_1++; /** * [tMysqlInput_1 main ] stop */ /** * [tAdvancedHash_row11 main ] start */ currentComponent = "tAdvancedHash_row11"; row11Struct row11_HashRow = new row11Struct(); row11_HashRow.ID = row11.ID; row11_HashRow.UUID = row11.UUID; row11_HashRow.PROP_NAME = row11.PROP_NAME; row11_HashRow.PRICE = row11.PRICE; row11_HashRow.SQFT = row11.SQFT; row11_HashRow.DESCRIPTION = row11.DESCRIPTION; row11_HashRow.NUM_BEDS = row11.NUM_BEDS; row11_HashRow.NUM_BATHS = row11.NUM_BATHS; row11_HashRow.TYPE = row11.TYPE; row11_HashRow.STATUS = row11.STATUS; row11_HashRow.DATA_SOURCE_ID = row11.DATA_SOURCE_ID; row11_HashRow.ZIP_CODE = row11.ZIP_CODE; tHash_Lookup_row11.put(row11_HashRow); tos_count_tAdvancedHash_row11++; /** * [tAdvancedHash_row11 main ] stop */ /** * [tMysqlInput_1 end ] start */ currentComponent = "tMysqlInput_1"; } rs_tMysqlInput_1.close(); stmt_tMysqlInput_1.close(); conn_tMysqlInput_1.close(); globalMap.put("tMysqlInput_1_NB_LINE", nb_line_tMysqlInput_1); ok_Hash.put("tMysqlInput_1", true); end_Hash.put("tMysqlInput_1", System.currentTimeMillis()); /** * [tMysqlInput_1 end ] stop */ /** * [tAdvancedHash_row11 end ] start */ currentComponent = "tAdvancedHash_row11"; tHash_Lookup_row11.endPut(); ok_Hash.put("tAdvancedHash_row11", true); end_Hash.put("tAdvancedHash_row11", System.currentTimeMillis()); /** * [tAdvancedHash_row11 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); } globalMap.put("tMysqlInput_1_SUBPROCESS_STATE", 1); }
From source file:talonetl.getpropfinacials_0_3.getPropFinacials.java
public void tMysqlInput_2Process(final java.util.Map<String, Object> globalMap) throws TalendException { globalMap.put("tMysqlInput_2_SUBPROCESS_STATE", 0); final boolean execStat = this.execStat; String iterateId = ""; int iterateLoop = 0; String currentComponent = ""; try {//from www .ja v a 2 s . com String currentMethodName = new Exception().getStackTrace()[0].getMethodName(); boolean resumeIt = currentMethodName.equals(resumeEntryMethodName); if (resumeEntryMethodName == null || resumeIt || globalResumeTicket) {// start // the // resume globalResumeTicket = true; row35Struct row35 = new row35Struct(); /** * [tAdvancedHash_row35 begin ] start */ ok_Hash.put("tAdvancedHash_row35", false); start_Hash.put("tAdvancedHash_row35", System.currentTimeMillis()); currentComponent = "tAdvancedHash_row35"; int tos_count_tAdvancedHash_row35 = 0; // connection name:row35 // source node:tMysqlInput_2 - inputs:(after_tFileInputXML_2) // outputs:(row35,row35) | target node:tAdvancedHash_row35 - // inputs:(row35) outputs:() // linked node: tMap_2 - inputs:(row30,row35) // outputs:(monthly_insurance__c,insurance__c,management__c,monthly_management__c,yearly_interest_payment_2__c) org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE matchingModeEnum_row35 = org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE.UNIQUE_MATCH; org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row35Struct> tHash_Lookup_row35 = org.talend.designer.components.lookup.memory.AdvancedMemoryLookup .<row35Struct>getLookup(matchingModeEnum_row35); globalMap.put("tHash_Lookup_row35", tHash_Lookup_row35); /** * [tAdvancedHash_row35 begin ] stop */ /** * [tMysqlInput_2 begin ] start */ ok_Hash.put("tMysqlInput_2", false); start_Hash.put("tMysqlInput_2", System.currentTimeMillis()); currentComponent = "tMysqlInput_2"; int tos_count_tMysqlInput_2 = 0; java.util.Calendar calendar_tMysqlInput_2 = java.util.Calendar.getInstance(); calendar_tMysqlInput_2.set(0, 0, 0, 0, 0, 0); java.util.Date year0_tMysqlInput_2 = calendar_tMysqlInput_2.getTime(); int nb_line_tMysqlInput_2 = 0; java.sql.Connection conn_tMysqlInput_2 = null; java.util.Map<String, routines.system.TalendDataSource> dataSources_tMysqlInput_2 = (java.util.Map<String, routines.system.TalendDataSource>) globalMap .get(KEY_DB_DATASOURCES); if (null != dataSources_tMysqlInput_2) { conn_tMysqlInput_2 = dataSources_tMysqlInput_2.get("").getConnection(); } else { java.lang.Class.forName("org.gjt.mm.mysql.Driver"); String url_tMysqlInput_2 = "jdbc:mysql://" + context.talon_Server + ":" + context.talon_Port + "/" + context.talon_Database + "?" + context.talon_AdditionalParams; String dbUser_tMysqlInput_2 = context.talon_Login; String dbPwd_tMysqlInput_2 = context.talon_Password; conn_tMysqlInput_2 = java.sql.DriverManager.getConnection(url_tMysqlInput_2, dbUser_tMysqlInput_2, dbPwd_tMysqlInput_2); } java.sql.Statement stmt_tMysqlInput_2 = conn_tMysqlInput_2.createStatement(); String dbquery_tMysqlInput_2 = "SELECT `PROPERTY_DATA`.`ID`, `PROPERTY_DATA`.`UUID`, `PROPERTY_DATA`.`PROP_NAME`, `PROPERTY_DATA`.`PRICE`, `PROPERTY_DATA`.`SQFT`, `PROPERTY_DATA`.`DESCRIPTION`, `PROPERTY_DATA`.`NUM_BEDS`, `PROPERTY_DATA`.`NUM_BATHS`, `PROPERTY_DATA`.`TYPE`, `PROPERTY_DATA`.`STATUS`, `PROPERTY_DATA`.`ZIP_CODE`, `PROPERTY_DATA`.`DATA_SOURCE_ID` FROM `PROPERTY_DATA`"; globalMap.put("tMysqlInput_2_QUERY", dbquery_tMysqlInput_2); java.sql.ResultSet rs_tMysqlInput_2 = stmt_tMysqlInput_2.executeQuery(dbquery_tMysqlInput_2); java.sql.ResultSetMetaData rsmd_tMysqlInput_2 = rs_tMysqlInput_2.getMetaData(); int colQtyInRs_tMysqlInput_2 = rsmd_tMysqlInput_2.getColumnCount(); String tmpContent_tMysqlInput_2 = null; while (rs_tMysqlInput_2.next()) { nb_line_tMysqlInput_2++; if (colQtyInRs_tMysqlInput_2 < 1) { row35.ID = 0; } else { if (rs_tMysqlInput_2.getObject(1) != null) { row35.ID = rs_tMysqlInput_2.getInt(1); } else { throw new RuntimeException("Null value in non-Nullable column"); } } if (colQtyInRs_tMysqlInput_2 < 2) { row35.UUID = null; } else { tmpContent_tMysqlInput_2 = rs_tMysqlInput_2.getString(2); if (tmpContent_tMysqlInput_2 != null) { row35.UUID = tmpContent_tMysqlInput_2; } else { row35.UUID = null; } } if (colQtyInRs_tMysqlInput_2 < 3) { row35.PROP_NAME = null; } else { tmpContent_tMysqlInput_2 = rs_tMysqlInput_2.getString(3); if (tmpContent_tMysqlInput_2 != null) { row35.PROP_NAME = tmpContent_tMysqlInput_2; } else { row35.PROP_NAME = null; } } if (colQtyInRs_tMysqlInput_2 < 4) { row35.PRICE = 0; } else { if (rs_tMysqlInput_2.getObject(4) != null) { row35.PRICE = rs_tMysqlInput_2.getFloat(4); } else { throw new RuntimeException("Null value in non-Nullable column"); } } if (colQtyInRs_tMysqlInput_2 < 5) { row35.SQFT = 0; } else { if (rs_tMysqlInput_2.getObject(5) != null) { row35.SQFT = rs_tMysqlInput_2.getFloat(5); } else { throw new RuntimeException("Null value in non-Nullable column"); } } if (colQtyInRs_tMysqlInput_2 < 6) { row35.DESCRIPTION = null; } else { tmpContent_tMysqlInput_2 = rs_tMysqlInput_2.getString(6); if (tmpContent_tMysqlInput_2 != null) { row35.DESCRIPTION = tmpContent_tMysqlInput_2; } else { row35.DESCRIPTION = null; } } if (colQtyInRs_tMysqlInput_2 < 7) { row35.NUM_BEDS = 0; } else { if (rs_tMysqlInput_2.getObject(7) != null) { row35.NUM_BEDS = rs_tMysqlInput_2.getFloat(7); } else { throw new RuntimeException("Null value in non-Nullable column"); } } if (colQtyInRs_tMysqlInput_2 < 8) { row35.NUM_BATHS = 0; } else { if (rs_tMysqlInput_2.getObject(8) != null) { row35.NUM_BATHS = rs_tMysqlInput_2.getFloat(8); } else { throw new RuntimeException("Null value in non-Nullable column"); } } if (colQtyInRs_tMysqlInput_2 < 9) { row35.TYPE = null; } else { tmpContent_tMysqlInput_2 = rs_tMysqlInput_2.getString(9); if (tmpContent_tMysqlInput_2 != null) { row35.TYPE = tmpContent_tMysqlInput_2; } else { row35.TYPE = null; } } if (colQtyInRs_tMysqlInput_2 < 10) { row35.STATUS = null; } else { tmpContent_tMysqlInput_2 = rs_tMysqlInput_2.getString(10); if (tmpContent_tMysqlInput_2 != null) { row35.STATUS = tmpContent_tMysqlInput_2; } else { row35.STATUS = null; } } if (colQtyInRs_tMysqlInput_2 < 11) { row35.DATA_SOURCE_ID = 0; } else { if (rs_tMysqlInput_2.getObject(11) != null) { row35.DATA_SOURCE_ID = rs_tMysqlInput_2.getInt(11); } else { throw new RuntimeException("Null value in non-Nullable column"); } } if (colQtyInRs_tMysqlInput_2 < 12) { row35.ZIP_CODE = 0; } else { if (rs_tMysqlInput_2.getObject(12) != null) { row35.ZIP_CODE = rs_tMysqlInput_2.getInt(12); } else { throw new RuntimeException("Null value in non-Nullable column"); } } /** * [tMysqlInput_2 begin ] stop */ /** * [tMysqlInput_2 main ] start */ currentComponent = "tMysqlInput_2"; tos_count_tMysqlInput_2++; /** * [tMysqlInput_2 main ] stop */ /** * [tAdvancedHash_row35 main ] start */ currentComponent = "tAdvancedHash_row35"; row35Struct row35_HashRow = new row35Struct(); row35_HashRow.ID = row35.ID; row35_HashRow.UUID = row35.UUID; row35_HashRow.PROP_NAME = row35.PROP_NAME; row35_HashRow.PRICE = row35.PRICE; row35_HashRow.SQFT = row35.SQFT; row35_HashRow.DESCRIPTION = row35.DESCRIPTION; row35_HashRow.NUM_BEDS = row35.NUM_BEDS; row35_HashRow.NUM_BATHS = row35.NUM_BATHS; row35_HashRow.TYPE = row35.TYPE; row35_HashRow.STATUS = row35.STATUS; row35_HashRow.DATA_SOURCE_ID = row35.DATA_SOURCE_ID; row35_HashRow.ZIP_CODE = row35.ZIP_CODE; tHash_Lookup_row35.put(row35_HashRow); tos_count_tAdvancedHash_row35++; /** * [tAdvancedHash_row35 main ] stop */ /** * [tMysqlInput_2 end ] start */ currentComponent = "tMysqlInput_2"; } rs_tMysqlInput_2.close(); stmt_tMysqlInput_2.close(); conn_tMysqlInput_2.close(); globalMap.put("tMysqlInput_2_NB_LINE", nb_line_tMysqlInput_2); ok_Hash.put("tMysqlInput_2", true); end_Hash.put("tMysqlInput_2", System.currentTimeMillis()); /** * [tMysqlInput_2 end ] stop */ /** * [tAdvancedHash_row35 end ] start */ currentComponent = "tAdvancedHash_row35"; tHash_Lookup_row35.endPut(); ok_Hash.put("tAdvancedHash_row35", true); end_Hash.put("tAdvancedHash_row35", System.currentTimeMillis()); /** * [tAdvancedHash_row35 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); } globalMap.put("tMysqlInput_2_SUBPROCESS_STATE", 1); }