Java Code Examples for java.sql.ResultSet#getNString()

The following examples show how to use java.sql.ResultSet#getNString() . These examples are extracted from open source projects. 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
@Test(expected = SQLFeatureNotSupportedException.class)
public void getNStringForColumnIndex() throws SQLException {
    for (ResultSet each : resultSets) {
        each.getNString(1);
    }
}
 
Example 2
@Test(expected = SQLFeatureNotSupportedException.class)
public void getNStringForColumnLabel() throws SQLException {
    for (ResultSet each : resultSets) {
        each.getNString("label");
    }
}
 
Example 3
Source Project: dts   File: ResultConvertUtils.java    License: Apache License 2.0 4 votes vote down vote up
private static Object getDataByType(int index, int columnType, ResultSet resultSet) throws SQLException {
    if (columnType == Types.BIT) {
        return resultSet.getByte(index);
    }
    if (columnType == Types.TINYINT) {
        return resultSet.getByte(index);
    }
    if (columnType == Types.SMALLINT) {
        return resultSet.getShort(index);
    }
    if (columnType == Types.INTEGER) {
        return resultSet.getInt(index);
    }
    if (columnType == Types.BIGINT) {
        return resultSet.getLong(index);
    }
    if (columnType == Types.FLOAT) {
        return resultSet.getFloat(index);
    }
    if (columnType == Types.DOUBLE) {
        return resultSet.getDouble(index);
    }
    if (columnType == Types.NUMERIC) {
        return resultSet.getInt(index);
    }
    if (columnType == Types.DECIMAL) {
        return resultSet.getBigDecimal(index);
    }
    if (columnType == Types.CHAR) {
        return resultSet.getString(index);
    }
    if (columnType == Types.VARCHAR) {
        return resultSet.getString(index);
    }
    if (columnType == Types.LONGNVARCHAR) {
        return resultSet.getString(index);
    }
    if (columnType == Types.DATE) {
        return resultSet.getDate(index);
    }
    if (columnType == Types.TIME) {
        return resultSet.getTime(index);
    }
    if (columnType == Types.NCHAR) {
        return resultSet.getNString(index);
    }
    if (columnType == Types.NVARCHAR) {
        return resultSet.getNString(index);
    }
    if (columnType == Types.OTHER) {
        return resultSet.getObject(index);
    }
    if (columnType == Types.BLOB) {
        return resultSet.getBlob(index);
    }
    if (columnType == Types.BOOLEAN) {
        return resultSet.getBoolean(index);
    }
    if (columnType == Types.ARRAY) {
        return resultSet.getArray(index);
    }
    if (columnType == Types.TIMESTAMP) {
        return resultSet.getTimestamp(index);
    }
    return resultSet.getObject(index);
}
 
Example 4
public String getNString(ResultSet r) throws SQLException {
  return r.getNString(ordinal);
}
 
Example 5
public String getNString(ResultSet r) throws SQLException {
  return r.getNString(label);
}
 
Example 6
Source Project: requery   File: NVarCharType.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public String fromResult(ResultSet results, int column) throws SQLException {
    return results.getNString(column);
}
 
Example 7
public String get(final ResultSet target) throws SQLException {
	return target.getNString(column);
}
 
Example 8
Source Project: mango   File: NStringTypeHandler.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public String getNullableResult(ResultSet rs, int index)
    throws SQLException {
  return rs.getNString(index);
}