@Override public Reader getClobAsCharacterStream(ResultSet rs, int columnIndex) throws SQLException { logger.debug("Returning CLOB as character stream"); if (this.wrapAsLob) { Clob clob = rs.getClob(columnIndex); return clob.getCharacterStream(); } else { return rs.getCharacterStream(columnIndex); } }
@Override public Reader getCharacterStream(String columnLabel) throws SQLException { return rs.getCharacterStream(columnLabel); }
@Override public Reader getCharacterStream(int columnIndex) throws SQLException { return rs.getCharacterStream(columnIndex); }
public Object get(ResultSet rs, String colName) throws SQLException { return rs.getCharacterStream(colName); }
@Override public java.io.Reader getCharacterStream(String columnLabel) throws SQLException { try { return rs.getCharacterStream(columnLabel); } catch (Throwable t) { throw checkException(t); } }
@Override public java.io.Reader getCharacterStream(int columnIndex) throws SQLException { try { return rs.getCharacterStream(columnIndex); } catch (Throwable t) { throw checkException(t); } }
@Override public void run() throws Exception { rs.getCharacterStream(1); } });
@Override public void run() throws Exception { rs.getCharacterStream("id"); } });
public void readLineHashesStream(DbSession dbSession, String fileUuid, Consumer<Reader> consumer) { Connection connection = dbSession.getConnection(); PreparedStatement pstmt = null; ResultSet rs = null; Reader reader = null; try { pstmt = connection.prepareStatement("SELECT line_hashes FROM file_sources WHERE file_uuid=? AND data_type='SOURCE'"); pstmt.setString(1, fileUuid); rs = pstmt.executeQuery(); if (rs.next()) { reader = rs.getCharacterStream(1); if (reader != null) { consumer.accept(reader); } } } catch (SQLException e) { throw new IllegalStateException("Fail to read FILE_SOURCES.LINE_HASHES of file " + fileUuid, e); } finally { IOUtils.closeQuietly(reader); DbUtils.closeQuietly(connection, pstmt, rs); } }
@Override public java.io.Reader resultSet_getCharacterStream(ResultSetProxy rs, int columnIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getCharacterStream(this, rs, columnIndex); } return rs.getResultSetRaw() .getCharacterStream(columnIndex); }
@Override public java.io.Reader resultSet_getCharacterStream(ResultSetProxy rs, String columnLabel) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getCharacterStream(this, rs, columnLabel); } return rs.getResultSetRaw() .getCharacterStream(columnLabel); }
result = resultSet.getSQLXML(columnLabel); } else if (Reader.class == type) { result = resultSet.getCharacterStream(columnLabel); } else { result = resultSet.getObject(columnLabel);
result = resultSet.getSQLXML(columnIndex); } else if (Reader.class == type) { result = resultSet.getCharacterStream(columnIndex); } else { result = resultSet.getObject(columnIndex);
@Override public int read() throws IOException { while (true) { try { if (current == null) { if (closed) { return -1; } if (!rs.next()) { close(); return -1; } current = rs.getCharacterStream(1); current = new BufferedReader(current); } int x = current.read(); if (x >= 0) { return x; } current = null; } catch (SQLException e) { throw DbException.convertToIOException(e); } } } @Override
@Override public Reader getCharacterStream(int columnIndex) throws SQLException { SQLException e = null; try { Reader value = delegate.getCharacterStream(columnIndex); eventListener.onAfterResultSetGet(resultSetInformation, columnIndex, value, null); return value; } catch (SQLException sqle) { e = sqle; eventListener.onAfterResultSetGet(resultSetInformation, columnIndex, null, e); throw e; } }
if (isStreamTextRequired()) { String value; try (Reader bodyReader = rs.getCharacterStream(columnIndex)) { if (bodyReader == null) { return null;
@Override public Reader getCharacterStream(String columnLabel) throws SQLException { SQLException e = null; try { Reader value = delegate.getCharacterStream(columnLabel); eventListener.onAfterResultSetGet(resultSetInformation, columnLabel, value, null); return value; } catch (SQLException sqle) { e = sqle; eventListener.onAfterResultSetGet(resultSetInformation, columnLabel, null, e); throw e; } }
@Override public int read() throws IOException { while (true) { try { if (current == null) { if (closed) { return -1; } if (!rs.next()) { close(); return -1; } current = rs.getCharacterStream(1); current = new BufferedReader(current); } int x = current.read(); if (x >= 0) { return x; } current = null; } catch (SQLException e) { throw DbException.convertToIOException(e); } } }
@Test public void testGetClobAsCharacterStream() throws SQLException { lobHandler.getClobAsCharacterStream(rs, 1); verify(rs).getCharacterStream(1); }
ValueLobDb.createSmallLob(Value.CLOB, s.getBytes(StandardCharsets.UTF_8)); } else { Reader in = rs.getCharacterStream(columnIndex); if (in == null) { v = ValueNull.INSTANCE;