类java.sql.SQLType源码实例Demo

下面列出了怎么用java.sql.SQLType的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: lams   文件: UpdatableResultSet.java
/**
 * 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));
        }
    }
}
 
源代码2 项目: Komondor   文件: JDBC42CallableStatementWrapper.java
/**
 * 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);
    }
}
 
@Override
public void updateObject(int columnIndex,
        Object x,
        SQLType targetSqlType,
        int scaleOrLength) throws SQLException {
    this.getCurrentResultSet().updateObject(columnIndex, x, targetSqlType);
}
 
源代码4 项目: Komondor   文件: JDBC42CallableStatementWrapper.java
/**
 * 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);
    }
}
 
源代码5 项目: lams   文件: ClientPreparedStatement.java
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());
        }
    }
}
 
源代码6 项目: lams   文件: ClientPreparedStatement.java
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);
        }
    }
}
 
源代码7 项目: lams   文件: PreparedStatementWrapper.java
/**
 * 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);
    }
}
 
源代码8 项目: lams   文件: CallableStatement.java
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);
    }
}
 
源代码9 项目: lams   文件: CallableStatement.java
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);
    }
}
 
源代码10 项目: lams   文件: CallableStatement.java
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);
    }
}
 
源代码11 项目: lams   文件: CallableStatement.java
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);
    }
}
 
源代码12 项目: lams   文件: CallableStatementWrapper.java
/**
 * 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);
    }
}
 
源代码13 项目: lams   文件: CallableStatementWrapper.java
/**
 * 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);
    }
}
 
源代码14 项目: lams   文件: CallableStatementWrapper.java
/**
 * 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);
    }
}
 
源代码15 项目: lams   文件: CallableStatementWrapper.java
/**
 * 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);
    }
}
 
源代码16 项目: lams   文件: CallableStatementWrapper.java
/**
 * 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);
    }
}
 
源代码17 项目: lams   文件: CallableStatementWrapper.java
/**
 * 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);
    }
}
 
源代码18 项目: Komondor   文件: JDBC42CallableStatementWrapper.java
/**
 * 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);
    }
}
 
源代码19 项目: lams   文件: CallableStatementWrapper.java
/**
 * 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);
    }
}
 
源代码20 项目: Komondor   文件: JDBC42CallableStatementWrapper.java
/**
 * 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);
    }
}
 
源代码21 项目: Komondor   文件: JDBC42CallableStatementWrapper.java
/**
 * 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);
    }
}
 
源代码22 项目: Komondor   文件: JDBC42PreparedStatementWrapper.java
/**
 * 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);
    }
}
 
源代码23 项目: r-course   文件: JDBC42CallableStatementWrapper.java
/**
 * 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);
    }
}
 
源代码24 项目: r-course   文件: JDBC42CallableStatementWrapper.java
/**
 * 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);
    }
}
 
源代码25 项目: r-course   文件: JDBC42CallableStatementWrapper.java
/**
 * 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);
    }
}
 
源代码26 项目: r-course   文件: JDBC42CallableStatementWrapper.java
/**
 * 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);
    }
}
 
源代码27 项目: Komondor   文件: JDBC42CallableStatementWrapper.java
/**
 * 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);
    }
}
 
源代码28 项目: r-course   文件: JDBC42CallableStatementWrapper.java
/**
 * 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);
    }
}
 
源代码29 项目: r-course   文件: JDBC42CallableStatementWrapper.java
/**
 * 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);
    }
}
 
源代码30 项目: r-course   文件: JDBC42CallableStatementWrapper.java
/**
 * 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);
    }
}