mirror of https://github.com/apache/druid.git
use prepared statement instead of string interpolation
This commit is contained in:
parent
e0ff2aa0d6
commit
6e18ff7ed4
|
@ -74,13 +74,15 @@ public class DatabaseRuleManager
|
||||||
@Override
|
@Override
|
||||||
public Void withHandle(Handle handle) throws Exception
|
public Void withHandle(Handle handle) throws Exception
|
||||||
{
|
{
|
||||||
List<Map<String, Object>> existing = handle.select(
|
List<Map<String, Object>> existing = handle
|
||||||
String.format(
|
.createQuery(
|
||||||
"SELECT id from %s where datasource='%s';",
|
String.format(
|
||||||
ruleTable,
|
"SELECT id from %s where datasource=:dataSource;",
|
||||||
defaultTier
|
ruleTable
|
||||||
|
)
|
||||||
)
|
)
|
||||||
);
|
.bind("dataSource", defaultTier)
|
||||||
|
.list();
|
||||||
|
|
||||||
if (!existing.isEmpty()) {
|
if (!existing.isEmpty()) {
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Reference in New Issue