/** * {@inheritDoc} */ @Override public SQLWarning getWarnings() throws SQLException { final RowSet rs = this.currentRowSet; GFXDExceptionData warning; if (rs != null) { warning = rs.getWarnings(); } else { warning = this.warnings; } if (warning != null) { return ThriftExceptionUtil.newSQLWarning(warning, null); } return null; }
/** * {@inheritDoc} */ @Override public SQLWarning getWarnings() throws SQLException { checkClosed(); GFXDExceptionData warnings = this.rowSet.getWarnings(); if (warnings != null) { return ThriftExceptionUtil.newSQLWarning(warnings, null); } else { return null; } }
public Object getFieldValue(_Fields field) { switch (field) { case ROWS: return getRows(); case FLAGS: return Byte.valueOf(getFlags()); case CURSOR_ID: return Integer.valueOf(getCursorId()); case STATEMENT_ID: return Integer.valueOf(getStatementId()); case CONN_ID: return Integer.valueOf(getConnId()); case TOKEN: return getToken(); case SOURCE: return getSource(); case OFFSET: return Integer.valueOf(getOffset()); case METADATA: return getMetadata(); case CURSOR_NAME: return getCursorName(); case WARNINGS: return getWarnings(); case ROW_IDS_FOR_UPDATE_OR_DELETE: return getRowIdsForUpdateOrDelete(); } throw new IllegalStateException(); }
/** * {@inheritDoc} */ @Override public ResultSet executeQuery() throws SQLException { checkClosed(); reset(); try { // don't throw exception in getLobSource rather return null and // service will failover to new node and do re-prepare as required RowSet rs = this.service.executePreparedQuery( getLobSource(false, "executeQuery"), statementId, this.paramsList, this); setCurrentRowSet(rs); this.warnings = rs.getWarnings(); return new ClientResultSet(this.conn, this, rs); } catch (GFXDException gfxde) { throw ThriftExceptionUtil.newSQLException(gfxde); } }
/** * {@inheritDoc} */ @Override public ResultSet executeQuery(String sql) throws SQLException { checkClosed(); reset(); try { RowSet rs = this.service.executeQuery(sql, getAttributes()); clearPendingTransactionAttrs(); setCurrentRowSet(rs); this.warnings = rs.getWarnings(); return new ClientResultSet(this.conn, this, rs); } catch (GFXDException gfxde) { throw ThriftExceptionUtil.newSQLException(gfxde); } }