Java Code Examples for com.mysql.cj.exceptions.MysqlErrorNumbers#SQL_STATE_ILLEGAL_ARGUMENT

The following examples show how to use com.mysql.cj.exceptions.MysqlErrorNumbers#SQL_STATE_ILLEGAL_ARGUMENT . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ClientPreparedStatement.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected long[] executeBatchInternal() throws SQLException {
    synchronized (checkClosed().getConnectionMutex()) {

        if (this.connection.isReadOnly()) {
            throw new SQLException(Messages.getString("PreparedStatement.25") + Messages.getString("PreparedStatement.26"),
                    MysqlErrorNumbers.SQL_STATE_ILLEGAL_ARGUMENT);
        }

        if (this.query.getBatchedArgs() == null || this.query.getBatchedArgs().size() == 0) {
            return new long[0];
        }

        // we timeout the entire batch, not individual statements
        int batchTimeout = getTimeoutInMillis();
        setTimeoutInMillis(0);

        resetCancelledState();

        try {
            statementBegins();

            clearWarnings();

            if (!this.batchHasPlainStatements && this.rewriteBatchedStatements.getValue()) {

                if (((PreparedQuery<?>) this.query).getParseInfo().canRewriteAsMultiValueInsertAtSqlLevel()) {
                    return executeBatchedInserts(batchTimeout);
                }

                if (!this.batchHasPlainStatements && this.query.getBatchedArgs() != null
                        && this.query.getBatchedArgs().size() > 3 /* cost of option setting rt-wise */) {
                    return executePreparedBatchAsMultiStatement(batchTimeout);
                }
            }

            return executeBatchSerially(batchTimeout);
        } finally {
            this.query.getStatementExecuting().set(false);

            clearBatch();
        }
    }
}
 
Example 2
Source File: OperationNotSupportedException.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
public OperationNotSupportedException() {
    super(Messages.getString("RowDataDynamic.10"), MysqlErrorNumbers.SQL_STATE_ILLEGAL_ARGUMENT);
}
 
Example 3
Source File: OperationNotSupportedException.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
public OperationNotSupportedException(String message) {
    super(message, MysqlErrorNumbers.SQL_STATE_ILLEGAL_ARGUMENT);
}
 
Example 4
Source File: ClientPreparedStatement.java    From FoxTelem with GNU General Public License v3.0 4 votes vote down vote up
@Override
protected long[] executeBatchInternal() throws SQLException {
    synchronized (checkClosed().getConnectionMutex()) {

        if (this.connection.isReadOnly()) {
            throw new SQLException(Messages.getString("PreparedStatement.25") + Messages.getString("PreparedStatement.26"),
                    MysqlErrorNumbers.SQL_STATE_ILLEGAL_ARGUMENT);
        }

        if (this.query.getBatchedArgs() == null || this.query.getBatchedArgs().size() == 0) {
            return new long[0];
        }

        // we timeout the entire batch, not individual statements
        int batchTimeout = getTimeoutInMillis();
        setTimeoutInMillis(0);

        resetCancelledState();

        try {
            statementBegins();

            clearWarnings();

            if (!this.batchHasPlainStatements && this.rewriteBatchedStatements.getValue()) {

                if (((PreparedQuery<?>) this.query).getParseInfo().canRewriteAsMultiValueInsertAtSqlLevel()) {
                    return executeBatchedInserts(batchTimeout);
                }

                if (!this.batchHasPlainStatements && this.query.getBatchedArgs() != null
                        && this.query.getBatchedArgs().size() > 3 /* cost of option setting rt-wise */) {
                    return executePreparedBatchAsMultiStatement(batchTimeout);
                }
            }

            return executeBatchSerially(batchTimeout);
        } finally {
            this.query.getStatementExecuting().set(false);

            clearBatch();
        }
    }
}
 
Example 5
Source File: OperationNotSupportedException.java    From FoxTelem with GNU General Public License v3.0 4 votes vote down vote up
public OperationNotSupportedException() {
    super(Messages.getString("RowDataDynamic.10"), MysqlErrorNumbers.SQL_STATE_ILLEGAL_ARGUMENT);
}
 
Example 6
Source File: OperationNotSupportedException.java    From FoxTelem with GNU General Public License v3.0 4 votes vote down vote up
public OperationNotSupportedException(String message) {
    super(message, MysqlErrorNumbers.SQL_STATE_ILLEGAL_ARGUMENT);
}