Package java.sql

Examples of java.sql.SQLDataException


            //none of the sqlstate supported by derby belongs to
            //TransientConnectionException DERBY-3074
            ex = new SQLNonTransientConnectionException(message, sqlState,
                    severity, t);
        } else if (sqlState.startsWith(SQLState.SQL_DATA_PREFIX)) {
            ex = new SQLDataException(message, sqlState, severity, t);
        } else if (sqlState.startsWith(SQLState.INTEGRITY_VIOLATION_PREFIX)) {
            ex = new SQLIntegrityConstraintViolationException(message, sqlState,
                    severity, t);
        } else if (sqlState.startsWith(SQLState.AUTHORIZATION_SPEC_PREFIX)) {
            ex = new SQLInvalidAuthorizationSpecException(message, sqlState,
View Full Code Here


        if (outputClass == null) {
            RowMapper rowMapper = new ColumnMapRowMapper();
            RowMapperResultSetExtractor<Map<String, Object>> mapper = new RowMapperResultSetExtractor<Map<String, Object>>(rowMapper);
            List<Map<String, Object>> data = mapper.extractData(rs);
            if (data.size() > 1) {
                throw new SQLDataException("Query result not unique for outputType=SelectOne. Got " + data.size() " count instead.");
            } else if (data.size() == 1) {
                // Set content depend on number of column from query result
                Map<String, Object> row = data.get(0);
                if (row.size() == 1) {
                    result = row.values().iterator().next();
                } else {
                    result = row;
                }
            }
        } else {
            Class<?> outputClzz = getCamelContext().getClassResolver().resolveClass(outputClass);
            RowMapper rowMapper = new BeanPropertyRowMapper(outputClzz);
            RowMapperResultSetExtractor<?> mapper = new RowMapperResultSetExtractor(rowMapper);
            List<?> data = mapper.extractData(rs);
            if (data.size() > 1) {
                throw new SQLDataException("Query result not unique for outputType=SelectOne. Got " + data.size() " count instead.");
            } else if (data.size() == 1) {
                result = data.get(0);
            }
        }
View Full Code Here

            errCode >= ExceptionSeverity.SESSION_SEVERITY) {
            //none of the sqlstate supported by derby belongs to
            //NonTransientConnectionException
            ex = new SQLTransientConnectionException(message, sqlState, errCode);
        } else if (sqlState.startsWith(SQLState.SQL_DATA_PREFIX)) {
            ex = new SQLDataException(message, sqlState, errCode);
        } else if (sqlState.startsWith(SQLState.INTEGRITY_VIOLATION_PREFIX)) {
            ex = new SQLIntegrityConstraintViolationException(message, sqlState,
                    errCode);
        } else if (sqlState.startsWith(SQLState.AUTHORIZATION_PREFIX)) {
            ex = new SQLInvalidAuthorizationSpecException(message, sqlState,
View Full Code Here

            //none of the sqlstate supported by derby belongs to
            //NonTransientConnectionException
            ex = new SQLTransientConnectionException(message, sqlState,
                    severity, t);
        } else if (sqlState.startsWith(SQLState.SQL_DATA_PREFIX)) {
            ex = new SQLDataException(message, sqlState, severity, t);
        } else if (sqlState.startsWith(SQLState.INTEGRITY_VIOLATION_PREFIX)) {
            ex = new SQLIntegrityConstraintViolationException(message, sqlState,
                    severity, t);
        } else if (sqlState.startsWith(SQLState.AUTHORIZATION_PREFIX)) {
            ex = new SQLInvalidAuthorizationSpecException(message, sqlState,
View Full Code Here

            //none of the sqlstate supported by derby belongs to
            //NonTransientConnectionException
            ex = new SQLTransientConnectionException(message, sqlState,
                    severity, t);
        } else if (sqlState.startsWith(SQLState.SQL_DATA_PREFIX)) {
            ex = new SQLDataException(message, sqlState, severity, t);
        } else if (sqlState.startsWith(SQLState.INTEGRITY_VIOLATION_PREFIX)) {
            ex = new SQLIntegrityConstraintViolationException(message, sqlState,
                    severity, t);
        } else if (sqlState.startsWith(SQLState.AUTHORIZATION_SPEC_PREFIX)) {
            ex = new SQLInvalidAuthorizationSpecException(message, sqlState,
View Full Code Here

            errCode >= ExceptionSeverity.SESSION_SEVERITY) {
            //none of the sqlstate supported by derby belongs to
            //NonTransientConnectionException
            ex = new SQLTransientConnectionException(message, sqlState, errCode);
        } else if (sqlState.startsWith(SQLState.SQL_DATA_PREFIX)) {
            ex = new SQLDataException(message, sqlState, errCode);
        } else if (sqlState.startsWith(SQLState.INTEGRITY_VIOLATION_PREFIX)) {
            ex = new SQLIntegrityConstraintViolationException(message, sqlState,
                    errCode);
        } else if (sqlState.startsWith(SQLState.AUTHORIZATION_SPEC_PREFIX)) {
            ex = new SQLInvalidAuthorizationSpecException(message, sqlState,
View Full Code Here

    assertFalse(this.dialect.indicatesFailure(new BatchUpdateException()));
    assertFalse(this.dialect.indicatesFailure(new RowSetWarning()));
    assertFalse(this.dialect.indicatesFailure(new SerialException()));
    assertFalse(this.dialect.indicatesFailure(new SQLClientInfoException()));
    assertFalse(this.dialect.indicatesFailure(new SQLNonTransientException()));
    assertFalse(this.dialect.indicatesFailure(new SQLDataException()));
    assertFalse(this.dialect.indicatesFailure(new SQLFeatureNotSupportedException()));
    assertFalse(this.dialect.indicatesFailure(new SQLIntegrityConstraintViolationException()));
    assertFalse(this.dialect.indicatesFailure(new SQLInvalidAuthorizationSpecException()));
    assertFalse(this.dialect.indicatesFailure(new SQLSyntaxErrorException()));
    assertFalse(this.dialect.indicatesFailure(new SQLRecoverableException()));
    assertFalse(this.dialect.indicatesFailure(new SQLTransientException()));
    assertFalse(this.dialect.indicatesFailure(new SQLTimeoutException()));
    assertFalse(this.dialect.indicatesFailure(new SQLTransactionRollbackException()));
    assertFalse(this.dialect.indicatesFailure(new SQLWarning()));
    assertFalse(this.dialect.indicatesFailure(new DataTruncation(1, false, false, 1, 1)));
    assertFalse(this.dialect.indicatesFailure(new SQLDataException()));
    assertFalse(this.dialect.indicatesFailure(new SyncFactoryException()));
    assertFalse(this.dialect.indicatesFailure(new SyncProviderException()));
  }
View Full Code Here

    assertFalse(this.dialect.indicatesFailure(new BatchUpdateException()));
    assertFalse(this.dialect.indicatesFailure(new RowSetWarning()));
    assertFalse(this.dialect.indicatesFailure(new SerialException()));
    assertFalse(this.dialect.indicatesFailure(new SQLClientInfoException()));
    assertFalse(this.dialect.indicatesFailure(new SQLNonTransientException()));
    assertFalse(this.dialect.indicatesFailure(new SQLDataException()));
    assertFalse(this.dialect.indicatesFailure(new SQLFeatureNotSupportedException()));
    assertFalse(this.dialect.indicatesFailure(new SQLIntegrityConstraintViolationException()));
    assertFalse(this.dialect.indicatesFailure(new SQLInvalidAuthorizationSpecException()));
    assertFalse(this.dialect.indicatesFailure(new SQLSyntaxErrorException()));
    assertFalse(this.dialect.indicatesFailure(new SQLRecoverableException()));
    assertFalse(this.dialect.indicatesFailure(new SQLTransientException()));
    assertFalse(this.dialect.indicatesFailure(new SQLTimeoutException()));
    assertFalse(this.dialect.indicatesFailure(new SQLTransactionRollbackException()));
    assertFalse(this.dialect.indicatesFailure(new SQLWarning()));
    assertFalse(this.dialect.indicatesFailure(new DataTruncation(1, false, false, 1, 1)));
    assertFalse(this.dialect.indicatesFailure(new SQLDataException()));
    assertFalse(this.dialect.indicatesFailure(new SyncFactoryException()));
    assertFalse(this.dialect.indicatesFailure(new SyncProviderException()));
  }
View Full Code Here

                // (permanently) closed or broken
                return new SQLNonTransientConnectionException(msg, sqlstate,
                        code, cause);
            }
        } else if (sqlstate.startsWith("22")) {
            return new SQLDataException(msg, sqlstate, code, cause);
        } else if (sqlstate.startsWith("23")) {
            return new SQLIntegrityConstraintViolationException(msg, sqlstate,
                    code, cause);
        } else if (sqlstate.startsWith("28")) {
            return new SQLInvalidAuthorizationSpecException(msg, sqlstate,
View Full Code Here

            //none of the sqlstate supported by derby belongs to
            //NonTransientConnectionException
            ex = new SQLTransientConnectionException(message, sqlState,
                    severity, t);
        } else if (sqlState.startsWith(SQLState.SQL_DATA_PREFIX)) {
            ex = new SQLDataException(message, sqlState, severity, t);
        } else if (sqlState.startsWith(SQLState.INTEGRITY_VIOLATION_PREFIX)) {
            ex = new SQLIntegrityConstraintViolationException(message, sqlState,
                    severity, t);
        } else if (sqlState.startsWith(SQLState.AUTHORIZATION_PREFIX)) {
            ex = new SQLInvalidAuthorizationSpecException(message, sqlState,
View Full Code Here

TOP

Related Classes of java.sql.SQLDataException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.