Skip to content
Snippets Groups Projects
Commit 46c49ea7 authored by serebrserg's avatar serebrserg
Browse files

METR-20494: add executeQuery methods with and without additionalDBParams

parent 469f4a16
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,7 @@ package ru.yandex.metrika.clickhouse;
import ru.yandex.metrika.clickhouse.copypaste.ClickhouseResponse;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Map;
......@@ -12,5 +13,7 @@ import java.util.Map;
*/
public interface CHStatement extends Statement {
ClickhouseResponse executeQueryClickhouseResponse(String sql) throws SQLException;
ClickhouseResponse executeQueryClickhouseResponse(String sql, Map<String, String> additionalDBParams) throws SQLException;
ClickhouseResponse executeQueryClickhouseResponse(String sql, Map<String, String> additionalDBParams, boolean ignoreDatabase) throws SQLException;
ResultSet executeQuery(String sql, Map<String, String> additionalDBParams) throws SQLException;
}
......@@ -61,7 +61,11 @@ public class CHStatementImpl implements CHStatement {
@Override
public ResultSet executeQuery(String sql) throws SQLException {
InputStream is = getInputStream(sql, null, false);
return executeQuery(sql, null);
}
public ResultSet executeQuery(String sql, Map<String, String> additionalDBParams) throws SQLException {
InputStream is = getInputStream(sql, additionalDBParams, false);
try {
currentResult = new CHResultSet(properties.isCompress()
? new ClickhouseLZ4Stream(is) : is, properties.getBufferSize(),
......@@ -76,7 +80,11 @@ public class CHStatementImpl implements CHStatement {
}
public ClickhouseResponse executeQueryClickhouseResponse(String sql) throws SQLException {
return executeQueryClickhouseResponse(sql, null, false);
return executeQueryClickhouseResponse(sql, null);
}
public ClickhouseResponse executeQueryClickhouseResponse(String sql, Map<String, String> additionalDBParams) throws SQLException {
return executeQueryClickhouseResponse(sql, additionalDBParams, false);
}
public ClickhouseResponse executeQueryClickhouseResponse(String sql, Map<String, String> additionalDBParams, boolean ignoreDatabase) throws SQLException {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment

Consent

On this website, we use the web analytics service Matomo to analyze and review the use of our website. Through the collected statistics, we can improve our offerings and make them more appealing for you. Here, you can decide whether to allow us to process your data and set corresponding cookies for these purposes, in addition to technically necessary cookies. Further information on data protection—especially regarding "cookies" and "Matomo"—can be found in our privacy policy. You can withdraw your consent at any time.