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
3 changed files with 74 additions and 1 deletions

52
PATCH_RELEASE_NOTE.md Normal file
View File

@@ -0,0 +1,52 @@
---
version: 7.2.1
module: https://talend.poolparty.biz/coretaxonomy/42
product:
- https://talend.poolparty.biz/coretaxonomy/23
---
# TPS-3918
| Info | Value |
| ---------------- | ---------------- |
| 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
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 <!-- mandatory -->
This patch contains the following fixes:
- TDI-43764 : MsSQL Output possible information loss when using UTF8 and NVARCHAR with MsSQL JDBC
## Prerequisites
Consider the following requirements for your system:
- Talend Studio 7.2.1 must be installed.
## Installation
- 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
- 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:
- 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

@@ -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) {