提交 d1780bf9 authored 作者: sylvain-ilm's avatar sylvain-ilm

avoid new method by passing parameter inside the connection string

上级 ad9bf4d1
......@@ -166,15 +166,8 @@ public abstract class TestBase {
* @return the connection
*/
public Connection getConnection(String name) throws SQLException {
return getConnection(name, null);
}
public Connection getConnection(final String name, final Boolean stdDropTableRestrict) throws SQLException {
String url = getURL(name, true);
if (stdDropTableRestrict != null) {
url = addOption(url, "STANDARD_DROP_TABLE_RESTRICT", stdDropTableRestrict.toString());
}
return getConnectionInternal(url, getUser(), getPassword());
return getConnectionInternal(getURL(name, true), getUser(),
getPassword());
}
/**
......
......@@ -292,7 +292,7 @@ public class TestCases extends TestBase {
private Statement createTable(final boolean stdDropTableRestrict) throws SQLException {
deleteDb("cases");
Connection conn = getConnection("cases", stdDropTableRestrict);
Connection conn = getConnection("cases;STANDARD_DROP_TABLE_RESTRICT=" + stdDropTableRestrict);
Statement stat = conn.createStatement();
stat.execute("create table test(id int)");
return stat;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论