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

The following examples show how to use java.sql.ResultSet#getNString() . 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 File: UnsupportedOperationResultSetTest.java    From sharding-jdbc-1.5.1 with Apache License 2.0 4 votes vote down vote up
@Test(expected = SQLFeatureNotSupportedException.class)
public void getNStringForColumnIndex() throws SQLException {
    for (ResultSet each : resultSets) {
        each.getNString(1);
    }
}
 
Example 2
Source File: UnsupportedOperationResultSetTest.java    From sharding-jdbc-1.5.1 with Apache License 2.0 4 votes vote down vote up
@Test(expected = SQLFeatureNotSupportedException.class)
public void getNStringForColumnLabel() throws SQLException {
    for (ResultSet each : resultSets) {
        each.getNString("label");
    }
}
 
Example 3
Source File: ResultConvertUtils.java    From dts with 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
Source File: AvaticaResultSetConversionsTest.java    From calcite-avatica with Apache License 2.0 4 votes vote down vote up
public String getNString(ResultSet r) throws SQLException {
  return r.getNString(ordinal);
}
 
Example 5
Source File: AvaticaResultSetConversionsTest.java    From calcite-avatica with Apache License 2.0 4 votes vote down vote up
public String getNString(ResultSet r) throws SQLException {
  return r.getNString(label);
}
 
Example 6
Source File: NVarCharType.java    From requery with 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
Source File: NStringResultSetGetter.java    From SimpleFlatMapper with MIT License 4 votes vote down vote up
public String get(final ResultSet target) throws SQLException {
	return target.getNString(column);
}
 
Example 8
Source File: NStringTypeHandler.java    From mango with Apache License 2.0 4 votes vote down vote up
@Override
public String getNullableResult(ResultSet rs, int index)
    throws SQLException {
  return rs.getNString(index);
}