Support 6.x mysql drivers
This commit is contained in:
parent
8b26e66d3b
commit
f03ec3f940
1 changed files with 15 additions and 2 deletions
|
@ -84,8 +84,21 @@ public class SDBDataSource {
|
||||||
|
|
||||||
// Ensure that MySQL handles unicode properly, else all kinds of
|
// Ensure that MySQL handles unicode properly, else all kinds of
|
||||||
// horrible nastiness ensues.
|
// horrible nastiness ensues.
|
||||||
if (DEFAULT_TYPE.equals(getDbType()) && !url.contains("?")) {
|
if (DEFAULT_TYPE.equals(getDbType())) {
|
||||||
url += "?useUnicode=yes&characterEncoding=utf8";
|
if (!url.contains("?")) {
|
||||||
|
url += "?useUnicode=yes&characterEncoding=utf8&nullNamePatternMatchesAll=true";
|
||||||
|
} else {
|
||||||
|
String urlLwr = url.toLowerCase();
|
||||||
|
if (!urlLwr.contains("useunicode")) {
|
||||||
|
url += "&useUnicode=yes";
|
||||||
|
}
|
||||||
|
if (urlLwr.contains("characterencoding")) {
|
||||||
|
url += "&characterEncoding=utf8";
|
||||||
|
}
|
||||||
|
if (urlLwr.contains("nullnamepatternmatchesall")) {
|
||||||
|
url += "&nullNamePatternMatchesAll=true";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return url;
|
return url;
|
||||||
|
|
Loading…
Add table
Reference in a new issue