use of org.apache.ignite.internal.processors.odbc.jdbc.JdbcQueryMetadataRequest in project ignite by apache.
the class JdbcThinResultSet method meta.
/**
* @return Results metadata.
* @throws SQLException On error.
*/
private List<JdbcColumnMeta> meta() throws SQLException {
if (finished && (!isQuery || autoClose))
throw new SQLException("Server cursor is already closed.", SqlStateCode.INVALID_CURSOR_STATE);
if (!metaInit) {
JdbcQueryMetadataResult res = stmt.conn.sendRequest(new JdbcQueryMetadataRequest(cursorId), stmt, stickyIO).response();
meta = res.meta();
metaInit = true;
}
return meta;
}
use of org.apache.ignite.internal.processors.odbc.jdbc.JdbcQueryMetadataRequest in project ignite by apache.
the class JdbcThinTcpIo method guessCapacity.
/**
* Try to guess request capacity.
*
* @param req Request.
* @return Expected capacity.
*/
private static int guessCapacity(JdbcRequest req) {
int cap;
if (req instanceof JdbcBatchExecuteRequest) {
List<JdbcQuery> qrys = ((JdbcBatchExecuteRequest) req).queries();
int cnt = !F.isEmpty(qrys) ? Math.min(MAX_BATCH_QRY_CNT, qrys.size()) : 0;
// One additional byte for autocommit and last batch flags.
cap = cnt * DYNAMIC_SIZE_MSG_CAP + 2;
} else if (req instanceof JdbcQueryCloseRequest)
cap = QUERY_CLOSE_MSG_SIZE;
else if (req instanceof JdbcQueryMetadataRequest)
cap = QUERY_META_MSG_SIZE;
else if (req instanceof JdbcQueryFetchRequest)
cap = QUERY_FETCH_MSG_SIZE;
else
cap = DYNAMIC_SIZE_MSG_CAP;
return cap;
}
Aggregations