Subject Re: [Firebird-Java] Exceptions on FBBackupManager
Author Guilherme Luis Bradasch
I was thinking in the same solution - parsing. But the problem I see
with that is that the textual messages can change - imagine
localization, or a new version of the server reporting different
errors. I'll have to look into that more deeply before I can decide

Thanks again,


On Fri, Jan 16, 2009 at 8:37 PM, Roman Rokytskyy <roman@...> wrote:
>> Thanks for the reply Roman. I'll do some parsing then. Unless there is
>> a better way to do a restore in Java?
> You could fork a gbak process from Java and check the error code when it
> is finished. However, I don't like this approach because of two issues:
> 1. You can hardly report anything else except "Error while doing
> restore.", since, AFAIK, the error codes are not that informative (and I
> suspect that there is only one error code, but check the docs).
> 2. gbak, if not used with -services switch, transfers data over the
> network. The wire protocol of Firebird is quite chatty and it is usually
> more efficient to use Services API, which does nothing else as starting
> gbak (not as a separate process, but the same code is used) on the
> remote host. This would create a file on remote file system, and it is
> faster to copy the file from the network using the normal file level
> copy routines.
> So, I would recommend to do the parsing... Also it would be great if you
> could contribute the code back to the driver.
> Thanks!
> Roman