JdbcResultSetMetaData(JdbcResultSet rs, JdbcPreparedStatement prep, ResultInterface result, String catalog, Trace trace, int id) { setTrace(trace, TraceObject.RESULT_SET_META_DATA, id); this.catalog = catalog; this.rs = rs; this.prep = prep; this.result = result; this.columnCount = result.getVisibleColumnCount(); }
JdbcResultSet(JdbcConnection conn, JdbcStatement stat, CommandInterface command, ResultInterface result, int id, boolean closeStatement, boolean scrollable, boolean updatable) { setTrace(conn.getSession().getTrace(), TraceObject.RESULT_SET, id); this.conn = conn; this.stat = stat; this.command = command; this.result = result; this.columnCount = result.getVisibleColumnCount(); this.closeStatement = closeStatement; this.scrollable = scrollable; this.updatable = updatable; }
cols = res.getVisibleColumnCount();
this.conn = conn; this.result = result; columnCount = result.getVisibleColumnCount(); for (int i = 0; i < columnCount; i++) { String t = result.getTableName(i);
private void sendRow(ResultInterface result) throws IOException { if (result.next()) { transfer.writeBoolean(true); Value[] v = result.currentRow(); for (int i = 0; i < result.getVisibleColumnCount(); i++) { if (clientVersion >= Constants.TCP_PROTOCOL_VERSION_12) { transfer.writeValue(v[i]); } else { writeValue(v[i]); } } } else { transfer.writeBoolean(false); } }
@Override public Value getValue(Session session) { query.setSession(session); try (ResultInterface result = query.query(2)) { Value v; if (!result.next()) { v = ValueNull.INSTANCE; } else { Value[] values = result.currentRow(); if (result.getVisibleColumnCount() == 1) { v = values[0]; } else { v = ValueArray.get(values); } if (result.hasNext()) { throw DbException.get(ErrorCode.SCALAR_SUBQUERY_CONTAINS_MORE_THAN_ONE_ROW); } } return v; } }
ResultInterface result = command.getMetaData(); cache.addObject(objectId, result); int columnCount = result.getVisibleColumnCount(); transfer.writeInt(SessionRemote.STATUS_OK). writeInt(columnCount).writeInt(0); int columnCount = result.getVisibleColumnCount(); int state = getState(old); transfer.writeInt(state).writeInt(columnCount); if (writeGeneratedKeys) { ResultInterface generatedKeys = result.getGeneratedKeys(); int columnCount = generatedKeys.getVisibleColumnCount(); transfer.writeInt(columnCount); int rowCount = generatedKeys.getRowCount();
JdbcResultSetMetaData(JdbcResultSet rs, JdbcPreparedStatement prep, ResultInterface result, String catalog, Trace trace, int id) { setTrace(trace, TraceObject.RESULT_SET_META_DATA, id); this.catalog = catalog; this.rs = rs; this.prep = prep; this.result = result; this.columnCount = result.getVisibleColumnCount(); }
JdbcResultSetMetaData(JdbcResultSet rs, JdbcPreparedStatement prep, ResultInterface result, String catalog, Trace trace, int id) { setTrace(trace, TraceObject.RESULT_SET_META_DATA, id); this.catalog = catalog; this.rs = rs; this.prep = prep; this.result = result; this.columnCount = result.getVisibleColumnCount(); }
JdbcResultSetMetaData(JdbcResultSet rs, JdbcPreparedStatement prep, ResultInterface result, String catalog, Trace trace, int id) { setTrace(trace, TraceObject.RESULT_SET_META_DATA, id); this.catalog = catalog; this.rs = rs; this.prep = prep; this.result = result; this.columnCount = result.getVisibleColumnCount(); }
JdbcResultSet(SessionInterface session, JdbcConnection conn, JdbcStatement stat, ResultInterface result, int id, boolean closeStatement, boolean scrollable) { setTrace(session.getTrace(), TraceObject.RESULT_SET, id); this.session = session; this.conn = conn; this.stat = stat; this.result = result; columnCount = result.getVisibleColumnCount(); this.closeStatement = closeStatement; this.scrollable = scrollable; }
JdbcResultSet(JdbcConnection conn, JdbcStatement stat, ResultInterface result, int id, boolean closeStatement, boolean scrollable, boolean updatable) { setTrace(conn.getSession().getTrace(), TraceObject.RESULT_SET, id); this.conn = conn; this.stat = stat; this.result = result; columnCount = result.getVisibleColumnCount(); this.closeStatement = closeStatement; this.scrollable = scrollable; this.updatable = updatable; }
JdbcResultSet(JdbcConnection conn, JdbcStatement stat, ResultInterface result, int id, boolean closeStatement, boolean scrollable, boolean updatable) { setTrace(conn.getSession().getTrace(), TraceObject.RESULT_SET, id); this.conn = conn; this.stat = stat; this.result = result; columnCount = result.getVisibleColumnCount(); this.closeStatement = closeStatement; this.scrollable = scrollable; this.updatable = updatable; }
private void sendRow(ResultInterface result) throws IOException { if (result.next()) { transfer.writeBoolean(true); Value[] v = result.currentRow(); for (int i = 0; i < result.getVisibleColumnCount(); i++) { if (clientVersion >= Constants.TCP_PROTOCOL_VERSION_12) { transfer.writeValue(v[i]); } else { writeValue(v[i]); } } } else { transfer.writeBoolean(false); } }
private void sendRow(ResultInterface result) throws IOException { if (result.next()) { transfer.writeBoolean(true); Value[] v = result.currentRow(); for (int i = 0; i < result.getVisibleColumnCount(); i++) { if (clientVersion >= Constants.TCP_PROTOCOL_VERSION_12) { transfer.writeValue(v[i]); } else { writeValue(v[i]); } } } else { transfer.writeBoolean(false); } }
@Override public Value getValue(Session session) { query.setSession(session); try (ResultInterface result = query.query(2)) { int rowcount = result.getRowCount(); if (rowcount > 1) { throw DbException.get(ErrorCode.SCALAR_SUBQUERY_CONTAINS_MORE_THAN_ONE_ROW); } Value v; if (rowcount <= 0) { v = ValueNull.INSTANCE; } else { result.next(); Value[] values = result.currentRow(); if (result.getVisibleColumnCount() == 1) { v = values[0]; } else { v = ValueArray.get(values); } } return v; } }
@Override public Value getValue(Session session) { query.setSession(session); ResultInterface result = query.query(2); try { int rowcount = result.getRowCount(); if (rowcount > 1) { throw DbException.get(ErrorCode.SCALAR_SUBQUERY_CONTAINS_MORE_THAN_ONE_ROW); } Value v; if (rowcount <= 0) { v = ValueNull.INSTANCE; } else { result.next(); Value[] values = result.currentRow(); if (result.getVisibleColumnCount() == 1) { v = values[0]; } else { v = ValueArray.get(values); } } return v; } finally { result.close(); } }
private static SimpleResultSet getSimpleResultSet(ResultInterface rs, int maxrows) { int columnCount = rs.getVisibleColumnCount(); SimpleResultSet simple = new SimpleResultSet(); simple.setAutoClose(false); for (int i = 0; i < columnCount; i++) { String name = rs.getColumnName(i); int sqlType = DataType.convertTypeToSQLType(rs.getColumnType(i)); int precision = MathUtils.convertLongToInt(rs.getColumnPrecision(i)); int scale = rs.getColumnScale(i); simple.addColumn(name, sqlType, precision, scale); } rs.reset(); for (int i = 0; i < maxrows && rs.next(); i++) { Object[] list = new Object[columnCount]; for (int j = 0; j < columnCount; j++) { list[j] = rs.currentRow()[j].getObject(); } simple.addRow(list); } return simple; }
private static SimpleResultSet getSimpleResultSet(ResultInterface rs, int maxrows) { int columnCount = rs.getVisibleColumnCount(); SimpleResultSet simple = new SimpleResultSet(); simple.setAutoClose(false); for (int i = 0; i < columnCount; i++) { String name = rs.getColumnName(i); int sqlType = DataType.convertTypeToSQLType(rs.getColumnType(i)); int precision = MathUtils.convertLongToInt(rs.getColumnPrecision(i)); int scale = rs.getColumnScale(i); simple.addColumn(name, sqlType, precision, scale); } rs.reset(); for (int i = 0; i < maxrows && rs.next(); i++) { Object[] list = new Object[columnCount]; for (int j = 0; j < columnCount; j++) { list[j] = rs.currentRow()[j].getObject(); } simple.addRow(list); } return simple; }