@Override public NClob getNClob(String columnLabel) throws SQLException { return rs.getNClob(columnLabel); }
@Override public NClob getNClob(int columnIndex) throws SQLException { return rs.getNClob(columnIndex); }
@Override public NClob getNClob(int columnIndex) throws SQLException { try { return rs.getNClob(columnIndex); } catch (Throwable t) { throw checkException(t); } }
@Override public NClob getNClob(String columnLabel) throws SQLException { try { return rs.getNClob(columnLabel); } catch (Throwable t) { throw checkException(t); } }
@Override protected X doExtract(ResultSet rs, String name, WrapperOptions options) throws SQLException { return javaTypeDescriptor.wrap( rs.getNClob( name ), options ); }
@Override public void run() throws Exception { rs.getNClob("id"); } });
@Override public void run() throws Exception { rs.getNClob(1); } });
public static NClob getNClob(final ResultSet resultSet, final String columnName) throws SQLException { return getNullableFrom(resultSet, rs -> rs.getNClob(columnName)); }
public static NClob getNClob(final ResultSet resultSet, final int ordinalPosition) throws SQLException { return getNullableFrom(resultSet, rs -> rs.getNClob(ordinalPosition)); }
@Override public NClob getNClob(String columnLabel) throws SQLException { SQLException e = null; try { NClob value = delegate.getNClob(columnLabel); eventListener.onAfterResultSetGet(resultSetInformation, columnLabel, value, null); return value; } catch (SQLException sqle) { e = sqle; eventListener.onAfterResultSetGet(resultSetInformation, columnLabel, null, e); throw e; } }
@Override public NClob getNClob(int columnIndex) throws SQLException { SQLException e = null; try { NClob value = delegate.getNClob(columnIndex); eventListener.onAfterResultSetGet(resultSetInformation, columnIndex, value, null); return value; } catch (SQLException sqle) { e = sqle; eventListener.onAfterResultSetGet(resultSetInformation, columnIndex, null, e); throw e; } }
@Override protected X doExtract(ResultSet rs, String name, WrapperOptions options) throws SQLException { Clob rsClob; if ( HANAClobTypeDescriptor.this.useUnicodeStringTypes ) { rsClob = rs.getNClob( name ); } else { rsClob = rs.getClob( name ); } if ( rsClob == null || rsClob.length() < HANAClobTypeDescriptor.this.maxLobPrefetchSize ) { return javaTypeDescriptor.wrap( rsClob, options ); } Clob clob = new MaterializedNClob( DataHelper.extractString( rsClob ) ); return javaTypeDescriptor.wrap( clob, options ); }
value = ModelBuilder.me.handleClob(rs.getClob(i)); } else if (types[i] == Types.NCLOB) { value = ModelBuilder.me.handleClob(rs.getNClob(i)); } else if (types[i] == Types.BLOB) { value = ModelBuilder.me.handleBlob(rs.getBlob(i));
value = handleClob(rs.getClob(i)); } else if (types[i] == Types.NCLOB) { value = handleClob(rs.getNClob(i)); } else if (types[i] == Types.BLOB) { value = handleBlob(rs.getBlob(i));
private List<Record> buildRecord(ResultSet rs, int pageSize) throws SQLException { List<Record> result = new ArrayList<Record>(); ResultSetMetaData rsmd = rs.getMetaData(); int columnCount = rsmd.getColumnCount(); String[] labelNames = new String[columnCount + 1]; int[] types = new int[columnCount + 1]; buildLabelNamesAndTypes(rsmd, labelNames, types); for (int k=0; k<pageSize && rs.next(); k++) { Record record = new Record(); Map<String, Object> columns = record.getColumns(); for (int i=1; i<=columnCount; i++) { Object value; if (types[i] < Types.BLOB) { value = rs.getObject(i); } else if (types[i] == Types.CLOB) { value = ModelBuilder.me.handleClob(rs.getClob(i)); } else if (types[i] == Types.NCLOB) { value = ModelBuilder.me.handleClob(rs.getNClob(i)); } else if (types[i] == Types.BLOB) { value = ModelBuilder.me.handleBlob(rs.getBlob(i)); } else { value = rs.getObject(i); } columns.put(labelNames[i], value); } result.add(record); } return result; }
value = ModelBuilder.me.handleClob(rs.getClob(i)); } else if (types[i] == Types.NCLOB) { value = ModelBuilder.me.handleClob(rs.getNClob(i)); } else if (types[i] == Types.BLOB) { value = ModelBuilder.me.handleBlob(rs.getBlob(i));
@Override public NClob resultSet_getNClob(ResultSetProxy resultSet, int columnIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSet_getNClob(this, resultSet, columnIndex); } NClob nclob = resultSet.getResultSetRaw().getNClob(columnIndex); return wrap(resultSet.getStatementProxy().getConnectionProxy(), nclob); }
@Override public NClob resultSet_getNClob(ResultSetProxy resultSet, String columnLabel) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSet_getNClob(this, resultSet, columnLabel); } NClob nclob = resultSet.getResultSetRaw() .getNClob(columnLabel); return wrap(resultSet.getStatementProxy().getConnectionProxy(), nclob); }
@Override protected X doExtract(ResultSet rs, String name, WrapperOptions options) throws SQLException { NClob rsNClob = rs.getNClob( name ); if ( rsNClob == null || rsNClob.length() < HANANClobTypeDescriptor.this.maxLobPrefetchSize ) { return javaTypeDescriptor.wrap( rsNClob, options ); } NClob nClob = new MaterializedNClob( DataHelper.extractString( rsNClob ) ); return javaTypeDescriptor.wrap( nClob, options ); }
resultSet.getString("message")); assertEquals("The exception column is not correct (1).", stackTrace, IOUtils.readStringAndClose(resultSet.getNClob("exception").getCharacterStream(), -1));