Compare commits

..

4 Commits

Author SHA1 Message Date
rlecomte-talend
087a4f79a8 TPS-3918 : MsSQL NVARCHAR Patch
Added PATCH_RELEASE_NOTE
2020-04-06 13:42:27 +02:00
rlecomte-talend
a4b5be8f1d TPS-3918 : MsSQL NVARCHAR Patch
Added PATCH_RELEASE_NOTE
2020-04-03 14:35:44 +02:00
Richard Lecomte
6b03649091 TDI-43764 : MsSQL NVARCHAR (#4518)
* TDI-43764 : MsSQL NVARCHAR

Use setNString method for NVARCHAR and NCHAR columns only for MS driver

* TDI-43764 : MsSQL NVARCHAR

Use setNString method for NTEXT columns only for MS driver
2020-04-03 11:41:58 +02:00
Richard Lecomte
968b1d9d20 TDI-43764 : MsSQL NVARCHAR (#4491)
* TDI-43764 : MsSQL NVARCHAR

Use setNString method for NVARCHAR and NCHAR columns

* TDI-43764 : MsSQL NVARCHAR

Use setNString method for NVARCHAR and NCHAR columns
2020-04-03 11:41:47 +02:00
4 changed files with 47 additions and 42 deletions

View File

@@ -5,26 +5,28 @@ product:
- https://talend.poolparty.biz/coretaxonomy/23
---
# TPS-4124
# TPS-3918
| Info | Value |
| ---------------- | ---------------- |
| Patch Name | Patch\_20200615\_TPS-4124\_v1-7.2.1 |
| Release Date | 2020-06-15 |
| Target Version | 20190620\_1446-V7.2.1 |
| Patch Name | Patch\_20200403\_TPS-3918\_v1-7.2.1 |
| Release Date | 2020-04-30 |
| Target Version | 7.2.1.20190620_1446 |
| Product affected | Talend Studio |
## Introduction
## Introduction
This is a self-contained patch.
**NOTE**: For information on how to obtain this patch, reach out to your Support contact at Talend.
## Fixed issues
## Fixed issues <!-- mandatory -->
This patch contains the following fixes:
- TPS-4124 [7.2.1] ClassCastException with tLibraryLoad's Dynamics Libs in Java 11 (TDI-44305)
- TDI-43764 : MsSQL Output possible information loss when using UTF8 and NVARCHAR with MsSQL JDBC
## Prerequisites
@@ -33,34 +35,18 @@ Consider the following requirements for your system:
- Talend Studio 7.2.1 must be installed.
## Installation
### Installing the patch using Software update
1) Logon TAC and switch to Configuration->Software Update, then enter the correct values and save referring to the documentation: https://help.talend.com/reader/f7Em9WV_cPm2RRywucSN0Q/j9x5iXV~vyxMlUafnDejaQ
2) Switch to Software update page, where the new patch will be listed. The patch can be downloaded from here into the nexus repository.
3) On Studio Side: Logon Studio with remote mode, on the logon page the Update button is displayed: click this button to install the patch.
### Installing the patch using Talend Studio
1) Create a folder named "patches" under your studio installer directory and copy the patch .zip file to this folder.
2) Restart your studio: a window pops up, then click OK to install the patch, or restart the commandline and the patch will be installed automatically.
### Installing the patch using Commandline
Execute the following commands:
1. Talend-Studio-win-x86_64.exe -nosplash -application org.talend.commandline.CommandLine -consoleLog -data commandline-workspace startServer -p 8002 --talendDebug
2. initRemote {tac_url} -ul {TAC login username} -up {TAC login password}
3. checkAndUpdate -tu {TAC login username} -tup {TAC login password}
- From the Talend Studio 7.2.1 installation folder, make a copy of the following files somewhere safe:
- plugins/org.talend.designer.components.localprovider_7.2.1.20190620_1446/components/templates/db_output_bulk.skeleton
- plugins/org.talend.designer.components.localprovider_7.2.1.20190620_1446/components/tMSSqlConnection/tMSSqlConnection_begin.javajet
- Unzip content of the patch zip onto your Talend Studio 7.2.1 folder.
## Uninstallation
Backup the Affected files list below. Uninstall the patch by restore the backup files.
- Replace the files overriden by the patch by the copy you made before unzipping.
## Affected files for this patch
The following files are installed by this patch:
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.localprovider\_7.2.1.20190614\_0309/components/tLibraryLoad/tLibraryLoad\_begin.javajet
- plugins/org.talend.designer.components.localprovider_7.2.1.20190620_1446/components/templates/db_output_bulk.skeleton
- plugins/org.talend.designer.components.localprovider_7.2.1.20190620_1446/components/tMSSqlConnection/tMSSqlConnection_begin.javajet

View File

@@ -17,19 +17,17 @@
<% if(hotLibs!=null&&hotLibs.size() > 0){%>
String[] libPaths_<%=cid %> = new String[] { <% for(Map<String, String> item : hotLibs) {%> <%=item.get("LIBPATH") %>, <%}%> };
java.net.URLClassLoader sysloader_<%=cid %> = (java.net.URLClassLoader) ClassLoader.getSystemClassLoader();
java.lang.reflect.Method method_<%=cid %> = java.net.URLClassLoader.class.getDeclaredMethod("addURL", new Class[] { java.net.URL.class });
method_<%=cid %>.setAccessible(true);
java.util.List<java.net.URL> libURL_<%=cid %> = new java.util.ArrayList<>();
for(String lib_<%=cid %>:libPaths_<%=cid %>) {
String[] libPaths_<%=cid %> = new String[] { <% for(Map<String, String> item : hotLibs){%> <%=item.get("LIBPATH") %>, <%}%> };
for(String lib_<%=cid %>:libPaths_<%=cid %> ){
String separator_<%=cid %> = System.getProperty("path.separator");
String[] jarFiles_<%=cid %> = lib_<%=cid %>.split(separator_<%=cid %>);
for(String jarFile_<%=cid %> : jarFiles_<%=cid %>) {
libURL_<%=cid %>.add( new java.io.File(jarFile_<%=cid %>).toURI().toURL() );
for(String jarFile_<%=cid %>:jarFiles_<%=cid %>){
method_<%=cid %>.invoke(sysloader_<%=cid %>, new Object[] { new java.io.File(jarFile_<%=cid %>).toURL() });
}
}
java.net.URL[] libURLArray_<%=cid %> = libURL_<%=cid %>.toArray(new java.net.URL[] {});
ClassLoader threadClassLoader_<%=cid %> = Thread.currentThread().getContextClassLoader();
java.net.URLClassLoader newthreadClassLoader_<%=cid %> = new java.net.URLClassLoader(libURLArray_<%=cid %>, threadClassLoader_<%=cid %>);
Thread.currentThread().setContextClassLoader(newthreadClassLoader_<%=cid %>);
<%}%>

View File

@@ -69,3 +69,5 @@ imports="
globalMap.put("conn_<%=cid%>",conn_<%=cid%>);
globalMap.put("shareIdentitySetting_<%=cid%>", <%=ElementParameterParser.getValue(node, "__SHARE_IDENTITY_SETTING__")%>);
globalMap.put("driver_<%=cid%>", "<%=ElementParameterParser.getValue(node, "__DRIVER__")%>");

View File

@@ -2062,7 +2062,26 @@ public class CLASS {
setStmt.append(prefix + cid + ".setNull(" + index + dynamic + ", java.sql.Types.DATE);\r\n");
}
setStmt.append("}\r\n");
} else {
} else if("String".equals(typeToGenerate)) {
if ("NVARCHAR".equalsIgnoreCase(column.dataType) || "NCHAR".equalsIgnoreCase(column.dataType) || "NTEXT".equalsIgnoreCase(column.dataType)) {
boolean useExistingConnection = "true".equals(ElementParameterParser.getValue(node,"__USE_EXISTING_CONNECTION__"));
setStmt.append("String driver = null;\r\n");
if (useExistingConnection) {
String connection = ElementParameterParser.getValue(node, "__CONNECTION__");
setStmt.append("driver = ((String)globalMap.get(\"driver_" + connection + "\"));\r\n");
} else {
setStmt.append("driver = \"" + ElementParameterParser.getValue(node, "__DRIVER__") +"\";\r\n");
}
setStmt.append("if (\"MSSQL_PROP\".equals(driver)) {\r\n");
setStmt.append(prefix + cid + ".setNString(" + index + dynamic + ", " + incomingConnName + "." + column.getName() + ");\r\n");
setStmt.append("} else {\r\n");
setStmt.append(prefix + cid + ".setString(" + index + dynamic + ", " + incomingConnName + "." + column.getName() + ");\r\n");
setStmt.append("}\r\n");
} else {
setStmt.append(prefix + cid + ".setString(" + index + dynamic + ", " + incomingConnName + "." + column.getName() + ");\r\n");
}
}else {
setStmt.append(prefix + cid + ".set" + typeToGenerate + "(" + index + dynamic + ", " + incomingConnName + "." + column.getName() + ");\r\n");
}
if(isObject) {