use of io.shardingjdbc.core.parsing.SQLJudgeEngine in project sharding-jdbc by shardingjdbc.
the class MasterSlaveStatement method executeUpdate.
@Override
public int executeUpdate(final String sql, final String[] columnNames) throws SQLException {
int result = 0;
SQLStatement sqlStatement = new SQLJudgeEngine(sql).judge();
for (Connection each : connection.getConnections(sqlStatement.getType())) {
Statement statement = each.createStatement(resultSetType, resultSetConcurrency, resultSetHoldability);
routedStatements.add(statement);
result += statement.executeUpdate(sql, columnNames);
}
return result;
}
use of io.shardingjdbc.core.parsing.SQLJudgeEngine in project sharding-jdbc by shardingjdbc.
the class MasterSlaveStatement method execute.
@Override
public boolean execute(final String sql, final int[] columnIndexes) throws SQLException {
boolean result = false;
SQLStatement sqlStatement = new SQLJudgeEngine(sql).judge();
for (Connection each : connection.getConnections(sqlStatement.getType())) {
Statement statement = each.createStatement(resultSetType, resultSetConcurrency, resultSetHoldability);
routedStatements.add(statement);
result = statement.execute(sql, columnIndexes);
}
return result;
}
use of io.shardingjdbc.core.parsing.SQLJudgeEngine in project sharding-jdbc by shardingjdbc.
the class MasterSlaveStatement method execute.
@Override
public boolean execute(final String sql, final String[] columnNames) throws SQLException {
boolean result = false;
SQLStatement sqlStatement = new SQLJudgeEngine(sql).judge();
for (Connection each : connection.getConnections(sqlStatement.getType())) {
Statement statement = each.createStatement(resultSetType, resultSetConcurrency, resultSetHoldability);
routedStatements.add(statement);
result = statement.execute(sql, columnNames);
}
return result;
}
use of io.shardingjdbc.core.parsing.SQLJudgeEngine in project sharding-jdbc by shardingjdbc.
the class MasterSlaveStatement method execute.
@Override
public boolean execute(final String sql) throws SQLException {
boolean result = false;
SQLStatement sqlStatement = new SQLJudgeEngine(sql).judge();
for (Connection each : connection.getConnections(sqlStatement.getType())) {
Statement statement = each.createStatement(resultSetType, resultSetConcurrency, resultSetHoldability);
routedStatements.add(statement);
result = statement.execute(sql);
}
return result;
}
use of io.shardingjdbc.core.parsing.SQLJudgeEngine in project sharding-jdbc by shardingjdbc.
the class MasterSlaveStatement method executeUpdate.
@Override
public int executeUpdate(final String sql, final int autoGeneratedKeys) throws SQLException {
int result = 0;
SQLStatement sqlStatement = new SQLJudgeEngine(sql).judge();
for (Connection each : connection.getConnections(sqlStatement.getType())) {
Statement statement = each.createStatement(resultSetType, resultSetConcurrency, resultSetHoldability);
routedStatements.add(statement);
result += statement.executeUpdate(sql, autoGeneratedKeys);
}
return result;
}
Aggregations