Improve options passed to MySQL driver
This commit is contained in:
parent
8e067aa6f0
commit
b8583b63d8
1 changed files with 9 additions and 3 deletions
|
@ -86,18 +86,24 @@ public class SDBDataSource {
|
||||||
// horrible nastiness ensues.
|
// horrible nastiness ensues.
|
||||||
if (DEFAULT_TYPE.equals(getDbType())) {
|
if (DEFAULT_TYPE.equals(getDbType())) {
|
||||||
if (!url.contains("?")) {
|
if (!url.contains("?")) {
|
||||||
url += "?useUnicode=yes&characterEncoding=utf8&nullNamePatternMatchesAll=true";
|
url += "?useUnicode=yes&characterEncoding=utf8&nullNamePatternMatchesAll=true&cachePrepStmts=true&useServerPrepStmts=true";
|
||||||
} else {
|
} else {
|
||||||
String urlLwr = url.toLowerCase();
|
String urlLwr = url.toLowerCase();
|
||||||
if (!urlLwr.contains("useunicode")) {
|
if (!urlLwr.contains("useunicode")) {
|
||||||
url += "&useUnicode=yes";
|
url += "&useUnicode=yes";
|
||||||
}
|
}
|
||||||
if (urlLwr.contains("characterencoding")) {
|
if (!urlLwr.contains("characterencoding")) {
|
||||||
url += "&characterEncoding=utf8";
|
url += "&characterEncoding=utf8";
|
||||||
}
|
}
|
||||||
if (urlLwr.contains("nullnamepatternmatchesall")) {
|
if (!urlLwr.contains("nullnamepatternmatchesall")) {
|
||||||
url += "&nullNamePatternMatchesAll=true";
|
url += "&nullNamePatternMatchesAll=true";
|
||||||
}
|
}
|
||||||
|
if (!urlLwr.contains("cacheprepstmts")) {
|
||||||
|
url += "&cachePrepStmts=true";
|
||||||
|
}
|
||||||
|
if (!urlLwr.contains("useserverprepstmts")) {
|
||||||
|
url += "&useServerPrepStmts=true";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue