/** * Set the specified column's data value. * * @param colIndex The index of the column in the row. * @param value The new column value. */ protected void setColValue(int colIndex, int jdbcType, Object value, int length) throws SQLException { super.setColValue(colIndex, jdbcType, value, length); if (!onInsertRow && currentRow == null) { throw new SQLException(Messages.get("error.resultset.norow"), "24000"); } colIndex--; ParamInfo pi; ColInfo ci = columns[colIndex]; if (onInsertRow) { pi = insertRow[colIndex]; if (pi == null) { pi = new ParamInfo(-1); pi.collation = ci.collation; pi.charsetInfo = ci.charsetInfo; insertRow[colIndex] = pi; } } else { if (updateRow == null) { updateRow = new ParamInfo[columnCount]; } pi = updateRow[colIndex]; if (pi == null) { pi = new ParamInfo(-1); pi.collation = ci.collation; pi.charsetInfo = ci.charsetInfo; updateRow[colIndex] = pi; } } if (value == null) { pi.value = null; pi.length = 0; pi.jdbcType = ci.jdbcType; pi.isSet = true; } else { pi.value = value; pi.length = length; pi.isSet = true; pi.jdbcType = jdbcType; pi.isUnicode = ci.sqlType.equals("ntext") || ci.sqlType.equals("nchar") || ci.sqlType.equals("nvarchar"); } }
public void registerOutParameter(int parameterIndex, int sqlType, int scale) throws SQLException { ParamInfo pi = getParameter(parameterIndex); pi.isOutput = true; if (Support.getJdbcTypeName(sqlType).equals("ERROR")) { throw new SQLException( Messages.get("error.generic.badtype", Integer.toString(sqlType)), "HY092"); } if (sqlType == java.sql.Types.CLOB) { pi.jdbcType = java.sql.Types.LONGVARCHAR; } else if (sqlType == java.sql.Types.BLOB) { pi.jdbcType = java.sql.Types.LONGVARBINARY; } else { pi.jdbcType = sqlType; } pi.scale = scale; }