java.sql.SQLType Java Examples

The following examples show how to use java.sql.SQLType. 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 Project: lams   Author: lamsfoundation   File: UpdatableResultSet.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Internal setObject implementation.
 * 
 * @param columnIndex
 * @param x
 * @param targetType
 * @param scaleOrLength
 * @throws SQLException
 */
protected void updateObjectInternal(int columnIndex, Object x, SQLType targetType, int scaleOrLength) throws SQLException {
    synchronized (checkClosed().getConnectionMutex()) {
        if (!this.onInsertRow) {
            if (!this.doingUpdates) {
                this.doingUpdates = true;
                syncUpdate();
            }

            if (targetType == null) {
                this.updater.setObject(columnIndex, x);
            } else {
                this.updater.setObject(columnIndex, x, targetType);
            }
        } else {
            if (targetType == null) {
                this.inserter.setObject(columnIndex, x);
            } else {
                this.inserter.setObject(columnIndex, x, targetType);
            }

            this.thisRow.setBytes(columnIndex - 1, this.inserter.getBytesRepresentation(columnIndex - 1));
        }
    }
}
 
Example #2
Source Project: Komondor   Author: wn-upf   File: JDBC42CallableStatementWrapper.java    License: GNU General Public License v3.0 5 votes vote down vote up
/**
 * Support for java.sql.JDBCType/java.sql.SQLType.
 * 
 * @param parameterName
 * @param x
 * @param targetSqlType
 * @param scaleOrLength
 * @throws SQLException
 */
public void setObject(String parameterName, Object x, SQLType targetSqlType, int scaleOrLength) throws SQLException {
    try {
        if (this.wrappedStmt != null) {
            ((CallableStatement) this.wrappedStmt).setObject(parameterName, x, targetSqlType, scaleOrLength);
        } else {
            throw SQLError.createSQLException("No operations allowed after statement closed", SQLError.SQL_STATE_GENERAL_ERROR, this.exceptionInterceptor);
        }
    } catch (SQLException sqlEx) {
        checkAndFireConnectionError(sqlEx);
    }
}
 
Example #3
Source Project: elastic-db-tools-for-java   Author: microsoft   File: MultiShardResultSet.java    License: MIT License 5 votes vote down vote up
@Override
public void updateObject(int columnIndex,
        Object x,
        SQLType targetSqlType,
        int scaleOrLength) throws SQLException {
    this.getCurrentResultSet().updateObject(columnIndex, x, targetSqlType);
}
 
Example #4
Source Project: Komondor   Author: wn-upf   File: JDBC42CallableStatementWrapper.java    License: GNU General Public License v3.0 5 votes vote down vote up
/**
 * Support for java.sql.JDBCType/java.sql.SQLType.
 * 
 * @param parameterName
 * @param sqlType
 * @param typeName
 * @throws SQLException
 */
public void registerOutParameter(String parameterName, SQLType sqlType, String typeName) throws SQLException {
    try {
        if (this.wrappedStmt != null) {
            ((CallableStatement) this.wrappedStmt).registerOutParameter(parameterName, sqlType, typeName);
        } else {
            throw SQLError.createSQLException("No operations allowed after statement closed", SQLError.SQL_STATE_GENERAL_ERROR, this.exceptionInterceptor);
        }
    } catch (SQLException sqlEx) {
        checkAndFireConnectionError(sqlEx);
    }
}
 
Example #5
Source Project: lams   Author: lamsfoundation   File: ClientPreparedStatement.java    License: GNU General Public License v2.0 5 votes vote down vote up
public void setObject(int parameterIndex, Object parameterObj, SQLType targetSqlType) throws SQLException {
    synchronized (checkClosed().getConnectionMutex()) {
        if (targetSqlType instanceof MysqlType) {
            ((PreparedQuery<?>) this.query).getQueryBindings().setObject(getCoreParameterIndex(parameterIndex), parameterObj, (MysqlType) targetSqlType);
        } else {
            setObject(parameterIndex, parameterObj, targetSqlType.getVendorTypeNumber());
        }
    }
}
 
Example #6
Source Project: lams   Author: lamsfoundation   File: ClientPreparedStatement.java    License: GNU General Public License v2.0 5 votes vote down vote up
public void setObject(int parameterIndex, Object x, SQLType targetSqlType, int scaleOrLength) throws SQLException {
    synchronized (checkClosed().getConnectionMutex()) {
        if (targetSqlType instanceof MysqlType) {
            ((PreparedQuery<?>) this.query).getQueryBindings().setObject(getCoreParameterIndex(parameterIndex), x, (MysqlType) targetSqlType,
                    scaleOrLength);
        } else {
            setObject(parameterIndex, x, targetSqlType.getVendorTypeNumber(), scaleOrLength);
        }
    }
}
 
Example #7
Source Project: lams   Author: lamsfoundation   File: PreparedStatementWrapper.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Support for java.sql.JDBCType/java.sql.SQLType.
 * 
 * @param parameterIndex
 * @param x
 * @param targetSqlType
 * @throws SQLException
 */
public void setObject(int parameterIndex, Object x, SQLType targetSqlType) throws SQLException {
    try {
        if (this.wrappedStmt != null) {
            ((PreparedStatement) this.wrappedStmt).setObject(parameterIndex, x, targetSqlType);
        } else {
            throw SQLError.createSQLException("No operations allowed after statement closed", MysqlErrorNumbers.SQL_STATE_GENERAL_ERROR,
                    this.exceptionInterceptor);
        }
    } catch (SQLException sqlEx) {
        checkAndFireConnectionError(sqlEx);
    }
}
 
Example #8
Source Project: lams   Author: lamsfoundation   File: CallableStatement.java    License: GNU General Public License v2.0 5 votes vote down vote up
public void registerOutParameter(int parameterIndex, SQLType sqlType, int scale) throws SQLException {
    if (sqlType instanceof MysqlType) {
        registerOutParameter(parameterIndex, (MysqlType) sqlType, scale);
    } else {
        registerOutParameter(parameterIndex, sqlType.getVendorTypeNumber(), scale);
    }
}
 
Example #9
Source Project: lams   Author: lamsfoundation   File: CallableStatement.java    License: GNU General Public License v2.0 5 votes vote down vote up
public void registerOutParameter(int parameterIndex, SQLType sqlType, String typeName) throws SQLException {
    if (sqlType instanceof MysqlType) {
        registerOutParameter(parameterIndex, (MysqlType) sqlType, typeName);
    } else {
        registerOutParameter(parameterIndex, sqlType.getVendorTypeNumber(), typeName);
    }
}
 
Example #10
Source Project: lams   Author: lamsfoundation   File: CallableStatement.java    License: GNU General Public License v2.0 5 votes vote down vote up
public void registerOutParameter(String parameterName, SQLType sqlType, int scale) throws SQLException {
    if (sqlType instanceof MysqlType) {
        registerOutParameter(getNamedParamIndex(parameterName, true), (MysqlType) sqlType, scale);
    } else {
        registerOutParameter(getNamedParamIndex(parameterName, true), sqlType.getVendorTypeNumber(), scale);
    }
}
 
Example #11
Source Project: lams   Author: lamsfoundation   File: CallableStatement.java    License: GNU General Public License v2.0 5 votes vote down vote up
public void registerOutParameter(String parameterName, SQLType sqlType, String typeName) throws SQLException {
    if (sqlType instanceof MysqlType) {
        registerOutParameter(getNamedParamIndex(parameterName, true), (MysqlType) sqlType, typeName);
    } else {
        registerOutParameter(parameterName, sqlType.getVendorTypeNumber(), typeName);
    }
}
 
Example #12
Source Project: lams   Author: lamsfoundation   File: CallableStatementWrapper.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Support for java.sql.JDBCType/java.sql.SQLType.
 * 
 * @param parameterIndex
 * @param sqlType
 * @throws SQLException
 */
public void registerOutParameter(int parameterIndex, SQLType sqlType) throws SQLException {
    try {
        if (this.wrappedStmt != null) {
            ((CallableStatement) this.wrappedStmt).registerOutParameter(parameterIndex, sqlType);
        } else {
            throw SQLError.createSQLException("No operations allowed after statement closed", MysqlErrorNumbers.SQL_STATE_GENERAL_ERROR,
                    this.exceptionInterceptor);
        }
    } catch (SQLException sqlEx) {
        checkAndFireConnectionError(sqlEx);
    }
}
 
Example #13
Source Project: lams   Author: lamsfoundation   File: CallableStatementWrapper.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Support for java.sql.JDBCType/java.sql.SQLType.
 * 
 * @param parameterIndex
 * @param sqlType
 * @param scale
 * @throws SQLException
 */
public void registerOutParameter(int parameterIndex, SQLType sqlType, int scale) throws SQLException {
    try {
        if (this.wrappedStmt != null) {
            ((CallableStatement) this.wrappedStmt).registerOutParameter(parameterIndex, sqlType, scale);
        } else {
            throw SQLError.createSQLException("No operations allowed after statement closed", MysqlErrorNumbers.SQL_STATE_GENERAL_ERROR,
                    this.exceptionInterceptor);
        }
    } catch (SQLException sqlEx) {
        checkAndFireConnectionError(sqlEx);
    }
}
 
Example #14
Source Project: lams   Author: lamsfoundation   File: CallableStatementWrapper.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Support for java.sql.JDBCType/java.sql.SQLType.
 * 
 * @param parameterIndex
 * @param sqlType
 * @param typeName
 * @throws SQLException
 */
public void registerOutParameter(int parameterIndex, SQLType sqlType, String typeName) throws SQLException {
    try {
        if (this.wrappedStmt != null) {
            ((CallableStatement) this.wrappedStmt).registerOutParameter(parameterIndex, sqlType, typeName);
        } else {
            throw SQLError.createSQLException("No operations allowed after statement closed", MysqlErrorNumbers.SQL_STATE_GENERAL_ERROR,
                    this.exceptionInterceptor);
        }
    } catch (SQLException sqlEx) {
        checkAndFireConnectionError(sqlEx);
    }
}
 
Example #15
Source Project: lams   Author: lamsfoundation   File: CallableStatementWrapper.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Support for java.sql.JDBCType/java.sql.SQLType.
 * 
 * @param parameterName
 * @param sqlType
 * @param scale
 * @throws SQLException
 */
public void registerOutParameter(String parameterName, SQLType sqlType, int scale) throws SQLException {
    try {
        if (this.wrappedStmt != null) {
            ((CallableStatement) this.wrappedStmt).registerOutParameter(parameterName, sqlType, scale);
        } else {
            throw SQLError.createSQLException("No operations allowed after statement closed", MysqlErrorNumbers.SQL_STATE_GENERAL_ERROR,
                    this.exceptionInterceptor);
        }
    } catch (SQLException sqlEx) {
        checkAndFireConnectionError(sqlEx);
    }
}
 
Example #16
Source Project: lams   Author: lamsfoundation   File: CallableStatementWrapper.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Support for java.sql.JDBCType/java.sql.SQLType.
 * 
 * @param parameterName
 * @param sqlType
 * @param typeName
 * @throws SQLException
 */
public void registerOutParameter(String parameterName, SQLType sqlType, String typeName) throws SQLException {
    try {
        if (this.wrappedStmt != null) {
            ((CallableStatement) this.wrappedStmt).registerOutParameter(parameterName, sqlType, typeName);
        } else {
            throw SQLError.createSQLException("No operations allowed after statement closed", MysqlErrorNumbers.SQL_STATE_GENERAL_ERROR,
                    this.exceptionInterceptor);
        }
    } catch (SQLException sqlEx) {
        checkAndFireConnectionError(sqlEx);
    }
}
 
Example #17
Source Project: lams   Author: lamsfoundation   File: CallableStatementWrapper.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Support for java.sql.JDBCType/java.sql.SQLType.
 * 
 * @param parameterIndex
 * @param x
 * @param targetSqlType
 * @param scaleOrLength
 * @throws SQLException
 */
@Override
public void setObject(int parameterIndex, Object x, SQLType targetSqlType, int scaleOrLength) throws SQLException {
    try {
        if (this.wrappedStmt != null) {
            ((CallableStatement) this.wrappedStmt).setObject(parameterIndex, x, targetSqlType, scaleOrLength);
        } else {
            throw SQLError.createSQLException("No operations allowed after statement closed", MysqlErrorNumbers.SQL_STATE_GENERAL_ERROR,
                    this.exceptionInterceptor);
        }
    } catch (SQLException sqlEx) {
        checkAndFireConnectionError(sqlEx);
    }
}
 
Example #18
Source Project: Komondor   Author: wn-upf   File: JDBC42CallableStatementWrapper.java    License: GNU General Public License v3.0 5 votes vote down vote up
/**
 * Support for java.sql.JDBCType/java.sql.SQLType.
 * 
 * @param parameterName
 * @param sqlType
 * @param scale
 * @throws SQLException
 */
public void registerOutParameter(String parameterName, SQLType sqlType, int scale) throws SQLException {
    try {
        if (this.wrappedStmt != null) {
            ((CallableStatement) this.wrappedStmt).registerOutParameter(parameterName, sqlType, scale);
        } else {
            throw SQLError.createSQLException("No operations allowed after statement closed", SQLError.SQL_STATE_GENERAL_ERROR, this.exceptionInterceptor);
        }
    } catch (SQLException sqlEx) {
        checkAndFireConnectionError(sqlEx);
    }
}
 
Example #19
Source Project: lams   Author: lamsfoundation   File: CallableStatementWrapper.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Support for java.sql.JDBCType/java.sql.SQLType.
 * 
 * @param parameterName
 * @param x
 * @param targetSqlType
 * @param scaleOrLength
 * @throws SQLException
 */
public void setObject(String parameterName, Object x, SQLType targetSqlType, int scaleOrLength) throws SQLException {
    try {
        if (this.wrappedStmt != null) {
            ((CallableStatement) this.wrappedStmt).setObject(parameterName, x, targetSqlType, scaleOrLength);
        } else {
            throw SQLError.createSQLException("No operations allowed after statement closed", MysqlErrorNumbers.SQL_STATE_GENERAL_ERROR,
                    this.exceptionInterceptor);
        }
    } catch (SQLException sqlEx) {
        checkAndFireConnectionError(sqlEx);
    }
}
 
Example #20
Source Project: Komondor   Author: wn-upf   File: JDBC42CallableStatementWrapper.java    License: GNU General Public License v3.0 5 votes vote down vote up
/**
 * Support for java.sql.JDBCType/java.sql.SQLType.
 * 
 * @param parameterIndex
 * @param sqlType
 * @param typeName
 * @throws SQLException
 */
public void registerOutParameter(int parameterIndex, SQLType sqlType, String typeName) throws SQLException {
    try {
        if (this.wrappedStmt != null) {
            ((CallableStatement) this.wrappedStmt).registerOutParameter(parameterIndex, sqlType, typeName);
        } else {
            throw SQLError.createSQLException("No operations allowed after statement closed", SQLError.SQL_STATE_GENERAL_ERROR, this.exceptionInterceptor);
        }
    } catch (SQLException sqlEx) {
        checkAndFireConnectionError(sqlEx);
    }
}
 
Example #21
Source Project: Komondor   Author: wn-upf   File: JDBC42CallableStatementWrapper.java    License: GNU General Public License v3.0 5 votes vote down vote up
/**
 * Support for java.sql.JDBCType/java.sql.SQLType.
 * 
 * @param parameterIndex
 * @param sqlType
 * @param scale
 * @throws SQLException
 */
public void registerOutParameter(int parameterIndex, SQLType sqlType, int scale) throws SQLException {
    try {
        if (this.wrappedStmt != null) {
            ((CallableStatement) this.wrappedStmt).registerOutParameter(parameterIndex, sqlType, scale);
        } else {
            throw SQLError.createSQLException("No operations allowed after statement closed", SQLError.SQL_STATE_GENERAL_ERROR, this.exceptionInterceptor);
        }
    } catch (SQLException sqlEx) {
        checkAndFireConnectionError(sqlEx);
    }
}
 
Example #22
Source Project: Komondor   Author: wn-upf   File: JDBC42PreparedStatementWrapper.java    License: GNU General Public License v3.0 5 votes vote down vote up
/**
 * Support for java.sql.JDBCType/java.sql.SQLType.
 * 
 * @param parameterIndex
 * @param x
 * @param targetSqlType
 * @param scaleOrLength
 * @throws SQLException
 */
public void setObject(int parameterIndex, Object x, SQLType targetSqlType, int scaleOrLength) throws SQLException {
    try {
        if (this.wrappedStmt != null) {
            ((PreparedStatement) this.wrappedStmt).setObject(parameterIndex, x, targetSqlType, scaleOrLength);
        } else {
            throw SQLError.createSQLException("No operations allowed after statement closed", SQLError.SQL_STATE_GENERAL_ERROR, this.exceptionInterceptor);
        }
    } catch (SQLException sqlEx) {
        checkAndFireConnectionError(sqlEx);
    }
}
 
Example #23
Source Project: r-course   Author: joanby   File: JDBC42CallableStatementWrapper.java    License: MIT License 5 votes vote down vote up
/**
 * Support for java.sql.JDBCType/java.sql.SQLType.
 * 
 * @param parameterIndex
 * @param sqlType
 * @param scale
 * @throws SQLException
 */
public void registerOutParameter(int parameterIndex, SQLType sqlType, int scale) throws SQLException {
    try {
        if (this.wrappedStmt != null) {
            ((CallableStatement) this.wrappedStmt).registerOutParameter(parameterIndex, sqlType, scale);
        } else {
            throw SQLError.createSQLException("No operations allowed after statement closed", SQLError.SQL_STATE_GENERAL_ERROR, this.exceptionInterceptor);
        }
    } catch (SQLException sqlEx) {
        checkAndFireConnectionError(sqlEx);
    }
}
 
Example #24
Source Project: r-course   Author: joanby   File: JDBC42CallableStatementWrapper.java    License: MIT License 5 votes vote down vote up
/**
 * Support for java.sql.JDBCType/java.sql.SQLType.
 * 
 * @param parameterIndex
 * @param sqlType
 * @param typeName
 * @throws SQLException
 */
public void registerOutParameter(int parameterIndex, SQLType sqlType, String typeName) throws SQLException {
    try {
        if (this.wrappedStmt != null) {
            ((CallableStatement) this.wrappedStmt).registerOutParameter(parameterIndex, sqlType, typeName);
        } else {
            throw SQLError.createSQLException("No operations allowed after statement closed", SQLError.SQL_STATE_GENERAL_ERROR, this.exceptionInterceptor);
        }
    } catch (SQLException sqlEx) {
        checkAndFireConnectionError(sqlEx);
    }
}
 
Example #25
Source Project: r-course   Author: joanby   File: JDBC42CallableStatementWrapper.java    License: MIT License 5 votes vote down vote up
/**
 * Support for java.sql.JDBCType/java.sql.SQLType.
 * 
 * @param parameterName
 * @param sqlType
 * @throws SQLException
 */
public void registerOutParameter(String parameterName, SQLType sqlType) throws SQLException {
    try {
        if (this.wrappedStmt != null) {
            ((CallableStatement) this.wrappedStmt).registerOutParameter(parameterName, sqlType);
        } else {
            throw SQLError.createSQLException("No operations allowed after statement closed", SQLError.SQL_STATE_GENERAL_ERROR, this.exceptionInterceptor);
        }
    } catch (SQLException sqlEx) {
        checkAndFireConnectionError(sqlEx);
    }
}
 
Example #26
Source Project: r-course   Author: joanby   File: JDBC42CallableStatementWrapper.java    License: MIT License 5 votes vote down vote up
/**
 * Support for java.sql.JDBCType/java.sql.SQLType.
 * 
 * @param parameterName
 * @param sqlType
 * @param scale
 * @throws SQLException
 */
public void registerOutParameter(String parameterName, SQLType sqlType, int scale) throws SQLException {
    try {
        if (this.wrappedStmt != null) {
            ((CallableStatement) this.wrappedStmt).registerOutParameter(parameterName, sqlType, scale);
        } else {
            throw SQLError.createSQLException("No operations allowed after statement closed", SQLError.SQL_STATE_GENERAL_ERROR, this.exceptionInterceptor);
        }
    } catch (SQLException sqlEx) {
        checkAndFireConnectionError(sqlEx);
    }
}
 
Example #27
Source Project: Komondor   Author: wn-upf   File: JDBC42CallableStatementWrapper.java    License: GNU General Public License v3.0 5 votes vote down vote up
/**
 * Support for java.sql.JDBCType/java.sql.SQLType.
 * 
 * @param parameterIndex
 * @param x
 * @param targetSqlType
 * @throws SQLException
 */
public void setObject(int parameterIndex, Object x, SQLType targetSqlType) throws SQLException {
    try {
        if (this.wrappedStmt != null) {
            ((CallableStatement) this.wrappedStmt).setObject(parameterIndex, x, targetSqlType);
        } else {
            throw SQLError.createSQLException("No operations allowed after statement closed", SQLError.SQL_STATE_GENERAL_ERROR, this.exceptionInterceptor);
        }
    } catch (SQLException sqlEx) {
        checkAndFireConnectionError(sqlEx);
    }
}
 
Example #28
Source Project: r-course   Author: joanby   File: JDBC42CallableStatementWrapper.java    License: MIT License 5 votes vote down vote up
/**
 * Support for java.sql.JDBCType/java.sql.SQLType.
 * 
 * @param parameterIndex
 * @param x
 * @param targetSqlType
 * @throws SQLException
 */
public void setObject(int parameterIndex, Object x, SQLType targetSqlType) throws SQLException {
    try {
        if (this.wrappedStmt != null) {
            ((CallableStatement) this.wrappedStmt).setObject(parameterIndex, x, targetSqlType);
        } else {
            throw SQLError.createSQLException("No operations allowed after statement closed", SQLError.SQL_STATE_GENERAL_ERROR, this.exceptionInterceptor);
        }
    } catch (SQLException sqlEx) {
        checkAndFireConnectionError(sqlEx);
    }
}
 
Example #29
Source Project: r-course   Author: joanby   File: JDBC42CallableStatementWrapper.java    License: MIT License 5 votes vote down vote up
/**
 * Support for java.sql.JDBCType/java.sql.SQLType.
 * 
 * @param parameterIndex
 * @param x
 * @param targetSqlType
 * @param scaleOrLength
 * @throws SQLException
 */
public void setObject(int parameterIndex, Object x, SQLType targetSqlType, int scaleOrLength) throws SQLException {
    try {
        if (this.wrappedStmt != null) {
            ((CallableStatement) this.wrappedStmt).setObject(parameterIndex, x, targetSqlType, scaleOrLength);
        } else {
            throw SQLError.createSQLException("No operations allowed after statement closed", SQLError.SQL_STATE_GENERAL_ERROR, this.exceptionInterceptor);
        }
    } catch (SQLException sqlEx) {
        checkAndFireConnectionError(sqlEx);
    }
}
 
Example #30
Source Project: r-course   Author: joanby   File: JDBC42CallableStatementWrapper.java    License: MIT License 5 votes vote down vote up
/**
 * Support for java.sql.JDBCType/java.sql.SQLType.
 * 
 * @param parameterName
 * @param x
 * @param targetSqlType
 * @throws SQLException
 */
public void setObject(String parameterName, Object x, SQLType targetSqlType) throws SQLException {
    try {
        if (this.wrappedStmt != null) {
            ((CallableStatement) this.wrappedStmt).setObject(parameterName, x, targetSqlType);
        } else {
            throw SQLError.createSQLException("No operations allowed after statement closed", SQLError.SQL_STATE_GENERAL_ERROR, this.exceptionInterceptor);
        }
    } catch (SQLException sqlEx) {
        checkAndFireConnectionError(sqlEx);
    }
}