public void backupDatabase(int options) throws SQLException { if (backupOutputStream == null) { throw new SQLException("No output stream specified for the backup."); } try (FbService service = attachServiceManager()) { executeServiceBackupOperation(service, getBackupSRB(service, options)); } }
public void restoreDatabase(int options) throws SQLException { if (restoreInputStream == null) { throw new SQLException("No input stream specified for the restore."); } try (FbService service = attachServiceManager()) { executeServiceRestoreOperation(service, getRestoreSRB(service, options)); } }
service.startServiceAction(srb); OutputStream currentLogger = getLogger(); ServiceRequestBuffer infoSRB = service.createServiceRequestBuffer(); ServiceParameterBuffer infoSPB = null; break; case isc_info_svc_line: int bytesToLog = readOutput(buffer, codePos, currentLogger); codePos += 3; switch (bytesToLog) {
private void executeServiceBackupOperation(FbService service, ServiceRequestBuffer srb) throws SQLException { try { service.startServiceAction(srb); ServiceRequestBuffer infoSRB = service.createServiceRequestBuffer(); infoSRB.addArgument(isc_info_svc_to_eof); int bufferSize = backupBufferSize; boolean processing = true; while (processing) { byte[] buffer = service.getServiceInfo(null, infoSRB, bufferSize); switch (buffer[0]) { case isc_info_svc_to_eof: if (readOutput(buffer, 0, backupOutputStream) == END_OF_STREAM) { processing = false; } break; case isc_info_truncated: bufferSize = bufferSize * 2; break; case isc_info_end: processing = false; break; default: throw new SQLException("Unexpected response from service."); } } } catch (IOException ioe) { throw new SQLException(ioe); } }
service.startServiceAction(srb); OutputStream currentLogger = getLogger(); ServiceRequestBuffer infoSRB = service.createServiceRequestBuffer(); ServiceParameterBuffer infoSPB = null; break; case isc_info_svc_line: int bytesToLog = readOutput(buffer, codePos, currentLogger); codePos += 3; switch (bytesToLog) {
private void executeServiceBackupOperation(FbService service, ServiceRequestBuffer srb) throws SQLException { try { service.startServiceAction(srb); ServiceRequestBuffer infoSRB = service.createServiceRequestBuffer(); infoSRB.addArgument(isc_info_svc_to_eof); int bufferSize = backupBufferSize; boolean processing = true; while (processing) { byte[] buffer = service.getServiceInfo(null, infoSRB, bufferSize); switch (buffer[0]) { case isc_info_svc_to_eof: if (readOutput(buffer, 0, backupOutputStream) == END_OF_STREAM) { processing = false; } break; case isc_info_truncated: bufferSize = bufferSize * 2; break; case isc_info_end: processing = false; break; default: throw new SQLException("Unexpected response from service."); } } } catch (IOException ioe) { throw new SQLException(ioe); } }
public void backupDatabase(int options) throws SQLException { if (backupOutputStream == null) { throw new SQLException("No output stream specified for the backup."); } try (FbService service = attachServiceManager()) { executeServiceBackupOperation(service, getBackupSRB(service, options)); } }
public void restoreDatabase(int options) throws SQLException { if (restoreInputStream == null) { throw new SQLException("No input stream specified for the restore."); } try (FbService service = attachServiceManager()) { executeServiceRestoreOperation(service, getRestoreSRB(service, options)); } }