use of org.firebirdsql.gds.ServiceRequestBuffer in project jaybird by FirebirdSQL.
the class FBUserManager method adminRoleAction.
/**
* Services API execution for setting and dropping the auto admin role mapping
*
* @param action
* @throws SQLException
* @throws IOException
*/
private void adminRoleAction(int action) throws SQLException, IOException {
try (FbService service = attachServiceManager()) {
ServiceRequestBuffer srb = service.createServiceRequestBuffer();
srb.addArgument(action);
setSecurityDatabaseArgument(srb);
executeServicesOperation(service, srb);
}
}
use of org.firebirdsql.gds.ServiceRequestBuffer in project jaybird by FirebirdSQL.
the class FBMaintenanceManager method setDatabaseAccessMode.
public void setDatabaseAccessMode(int mode) throws SQLException {
if (mode != ACCESS_MODE_READ_WRITE && mode != ACCESS_MODE_READ_ONLY) {
throw new IllegalArgumentException("mode must be one of ACCESS_MODE_READ_WRITE or ACCESS_MODE_READ_ONLY");
}
try (FbService service = attachServiceManager()) {
ServiceRequestBuffer srb = createDefaultPropertiesSRB(service);
srb.addArgument(isc_spb_prp_access_mode, (byte) mode);
executeServicesOperation(service, srb);
}
}
use of org.firebirdsql.gds.ServiceRequestBuffer in project jaybird by FirebirdSQL.
the class FBMaintenanceManager method executePropertiesOperation.
/**
* Execute a isc_spb_prp_* (properties) services operation.
*
* @param operation
* The identifier for the operation to be executed
* @throws SQLException
* if a database access error occurs
*/
private void executePropertiesOperation(int operation) throws SQLException {
try (FbService service = attachServiceManager()) {
ServiceRequestBuffer srb = createPropertiesSRB(service, operation);
executeServicesOperation(service, srb);
}
}
use of org.firebirdsql.gds.ServiceRequestBuffer in project jaybird by FirebirdSQL.
the class FBMaintenanceManager method setDefaultCacheBuffer.
public void setDefaultCacheBuffer(int pageCount) throws SQLException {
if (pageCount != 0 && pageCount < 50) {
throw new IllegalArgumentException("page count must be 0 or >= 50, value was: " + pageCount);
}
try (FbService service = attachServiceManager()) {
ServiceRequestBuffer srb = createDefaultPropertiesSRB(service);
srb.addArgument(isc_spb_prp_page_buffers, pageCount);
executeServicesOperation(service, srb);
}
}
use of org.firebirdsql.gds.ServiceRequestBuffer in project jaybird by FirebirdSQL.
the class FBMaintenanceManager method bringDatabaseOnline.
public void bringDatabaseOnline(byte operationMode) throws SQLException {
if (operationMode != OPERATION_MODE_NORMAL && operationMode != OPERATION_MODE_MULTI && operationMode != OPERATION_MODE_SINGLE) {
throw new IllegalArgumentException("Operation mode must be " + "one of: OPERATION_MODE_NORMAL, OPERATION_MODE_MULTI, OPERATION_MODE_SINGLE");
}
try (FbService service = attachServiceManager()) {
ServiceRequestBuffer srb = createDefaultPropertiesSRB(service);
srb.addArgument(isc_spb_prp_online_mode, operationMode);
executeServicesOperation(service, srb);
}
}
Aggregations