Search in sources :

Example 11 with FbService

use of org.firebirdsql.gds.ng.FbService in project jaybird by FirebirdSQL.

the class FBTraceManager method suspendTraceSession.

/**
 * Suspends a trace session with the given trace session ID
 *
 * @param traceSessionId
 *         The trace session ID
 * @throws SQLException
 */
public void suspendTraceSession(int traceSessionId) throws SQLException {
    try (FbService service = attachServiceManager()) {
        service.startServiceAction(getTraceSPB(service, isc_action_svc_trace_suspend, traceSessionId));
        queueService(service);
    } catch (IOException ioe) {
        throw new SQLException(ioe);
    }
}
Also used : SQLException(java.sql.SQLException) FbService(org.firebirdsql.gds.ng.FbService)

Example 12 with FbService

use of org.firebirdsql.gds.ng.FbService in project jaybird by FirebirdSQL.

the class FBUserManager method userAction.

/**
 * Perform the specified action.
 *
 * @param action
 * @param user
 * @throws SQLException
 * @throws IOException
 */
private void userAction(int action, User user) throws SQLException, IOException {
    try (FbService service = attachServiceManager()) {
        ServiceRequestBuffer srb = getUserSRB(service, action, user);
        setSecurityDatabaseArgument(srb);
        executeServicesOperation(service, srb);
    }
}
Also used : ServiceRequestBuffer(org.firebirdsql.gds.ServiceRequestBuffer) FbService(org.firebirdsql.gds.ng.FbService)

Example 13 with FbService

use of org.firebirdsql.gds.ng.FbService in project jaybird by FirebirdSQL.

the class TestJaybirdBlobBackupProblem method attachToServiceManager.

private FbService attachToServiceManager() throws SQLException {
    FbService service = dbFactory.serviceConnect(createServiceProperties());
    service.attach();
    assertTrue("Handle should be attached when isc_service_attach returns normally.", service.isAttached());
    return service;
}
Also used : FbService(org.firebirdsql.gds.ng.FbService)

Example 14 with FbService

use of org.firebirdsql.gds.ng.FbService 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);
    }
}
Also used : ServiceRequestBuffer(org.firebirdsql.gds.ServiceRequestBuffer) FbService(org.firebirdsql.gds.ng.FbService)

Example 15 with FbService

use of org.firebirdsql.gds.ng.FbService 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);
    }
}
Also used : ServiceRequestBuffer(org.firebirdsql.gds.ServiceRequestBuffer) FbService(org.firebirdsql.gds.ng.FbService)

Aggregations

FbService (org.firebirdsql.gds.ng.FbService)29 ServiceRequestBuffer (org.firebirdsql.gds.ServiceRequestBuffer)20 SQLException (java.sql.SQLException)6 Test (org.junit.Test)1