use of org.firebirdsql.gds.ServiceRequestBuffer in project jaybird by FirebirdSQL.
the class FBStatisticsManager method getHeaderPage.
public void getHeaderPage() throws SQLException {
try (FbService service = attachServiceManager()) {
ServiceRequestBuffer srb = createStatsSRB(service, isc_spb_sts_hdr_pages);
executeServicesOperation(service, srb);
}
}
use of org.firebirdsql.gds.ServiceRequestBuffer in project jaybird by FirebirdSQL.
the class FBStatisticsManager method getDatabaseStatistics.
public void getDatabaseStatistics() throws SQLException {
try (FbService service = attachServiceManager()) {
ServiceRequestBuffer srb = createDefaultStatsSRB(service);
executeServicesOperation(service, srb);
}
}
use of org.firebirdsql.gds.ServiceRequestBuffer in project jaybird by FirebirdSQL.
the class FBStatisticsManager method getDatabaseStatistics.
public void getDatabaseStatistics(int options) throws SQLException {
if (options != 0 && (options | possibleStatistics) != possibleStatistics) {
throw new IllegalArgumentException("options must be 0 or a " + "combination of DATA_TABLE_STATISTICS, " + "SYSTEM_TABLE_STATISTICS, INDEX_STATISTICS, or 0");
}
try (FbService service = attachServiceManager()) {
ServiceRequestBuffer srb = createStatsSRB(service, options);
executeServicesOperation(service, srb);
}
}
use of org.firebirdsql.gds.ServiceRequestBuffer in project jaybird by FirebirdSQL.
the class FBTraceManager method getTraceSPB.
/**
* Creates and returns the "trace" service request buffer for the Service
* Manager.
*
* @param service Service handle
* @param action
* The isc_action_svc_trace_* action to be used
* @param traceSessionId
* The trace session ID
* @return the "trace" service request buffer for the Service Manager.
* @throws SQLException
*/
private ServiceRequestBuffer getTraceSPB(FbService service, int action, int traceSessionId) throws SQLException {
ServiceRequestBuffer traceSPB = getTraceSPB(service, action);
traceSPB.addArgument(isc_spb_trc_id, traceSessionId);
return traceSPB;
}
use of org.firebirdsql.gds.ServiceRequestBuffer in project jaybird by FirebirdSQL.
the class FBTraceManager method startTraceSession.
/**
* Starts a trace session with an optional trace session name and configuration
*
* @param traceSessionName
* The trace session name (optional)
* @param configuration
* The trace configuration. For an example, look into fbtrace.conf in the root directory of your
* Firebird installation
* @throws SQLException
*/
public void startTraceSession(String traceSessionName, String configuration) throws SQLException {
if (configuration == null || configuration.equals("")) {
throw new SQLException("No configuration provided");
}
if (traceSessionName == null) {
traceSessionName = "";
}
synchronized (this) {
OutputStream currentLogger = getLogger();
if (currentLogger instanceof TraceStream) {
currentLogger = ((TraceStream) currentLogger).unwrap();
}
setLogger(new TraceStream(currentLogger, traceSessionName));
FbService service = attachServiceManager();
ServiceRequestBuffer traceSPB = getTraceSPB(service, isc_action_svc_trace_start, traceSessionName, configuration);
Thread t = new Thread(new TraceTask(service, traceSPB));
t.start();
}
}
Aggregations