Files
tdi-studio-se/main/plugins/org.talend.designer.codegen/components/tMysqlInput/tMysqlInput_end.javajet
2022-07-19 01:08:09 +02:00

52 lines
1.2 KiB
Plaintext

<%@ jet
imports="
org.talend.core.model.process.INode
org.talend.designer.codegen.config.CodeGeneratorArgument
org.talend.core.model.process.ElementParameterParser
"
%>
<%@ include file="../templates/Log4j/Log4jDBConnUtil.javajet"%>
<%
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
INode node = (INode)codeGenArgument.getArgument();
String cid = node.getUniqueName();
String useExistingConn = ElementParameterParser.getValue(node,"__USE_EXISTING_CONNECTION__");
%>
}
}finally{
if (rs_<%=cid%> != null) {
rs_<%=cid%>.close();
}
if (stmt_<%=cid%> != null) {
stmt_<%=cid%>.close();
}
<%
if(!("true").equals(useExistingConn))
{
%>
if(conn_<%=cid%> != null && !conn_<%=cid%>.isClosed()) {
<%log4jCodeGenerateUtil.close(node);%>
}
<%
}
%>
}
<%
boolean isAmazonAurora = node.isVirtualGenerateNode() && (cid.matches("^.*?tAmazonAuroraInput_\\d+_in$") || cid.matches("^.*?tDBInput_\\d+_in$"));
if(isAmazonAurora){
// why 3: ==> "_in".length()
%>
globalMap.put("<%= cid.substring(0,cid.length() - 3) %>_NB_LINE",nb_line_<%=cid%>);
<%
}else{
%>
globalMap.put("<%=cid %>_NB_LINE",nb_line_<%=cid%>);
<%
}
%>
<%
log4jCodeGenerateUtil.retrieveRecordsCount(node);
%>