Subject Re: Embedded backup (was: setAutocommit ...)
Author nagypapi
Here's more or less what I used for testing.

You can run it without an argument - it will then try PURE_JAVA
backup, or the first argument specifies what kind of backup it should try.
Change the variables in the code to match your connection parameters.

java file content:

import java.sql.*;

class JBIRD2PureJavaError {
Connection conn;
//set these to your bidding
String dbuser="SYSDBA",dbpass="masterkey",
String databasePath="pathToYourDB";
static String backup_type="PURE_JAVA";

public static void main(String args[]) {
if(args.length>0) backup_type=args[0];
new JBIRD2PureJavaError();

JBIRD2PureJavaError() {

try{ Class.forName("org.firebirdsql.jdbc.FBDriver").newInstance();
String connstring="jdbc:firebirdsql:embedded:"+databasePath;
if(charset!=null||role!=null) connstring+="?";
conn = DriverManager.getConnection(connstring,dbuser,dbpass);
} catch(Exception e) {
System.out.println("Backing up with backup type "+backup_type+":");
FBBackupManager fbBackup=new FBBackupManager(backup_type);
} catch(Exception e) {e.printStackTrace(System.out);}

try{conn.close();}catch(Exception e) {e.printStackTrace(System.out);}

--- In, "Roman Rokytskyy"
<rrokytskyy@a...> wrote:
> > 1. "PURE_JAVA" constructor created FBBackupManager throws the
> > following exception if I backupDatabase():
> Do you have a test case or small code snippet for it?
> > 2. I created an FBBackupManager with an "EMBEDDED" constructor
> > parameter. By default I set the host to setHost("localhost"). Because
> > of this, the backupDatabase always threw a
> > "org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544344. I/O
> > error for file CreateFile (open) ..."
> Which is correct, since embedded can also act as a client library.
When you
> specify the host name, you tell it to go to the specified server
instead of
> accessing the local db.
> > 3. It finds and uses jaybird2.dll and fbembed.dll if I place them in
> > the program's (working) dir, but it doesn't find firebird.msg, which I
> > eventually placed in windows/system32.
> Also correct, since this path is controlled by the firebird.conf and
> %FIREBIRD% variables.
> > (4. If I don't set user or pass with setUser/setPassword it throws a
> > NullPointerException which is perfectly correct, just not very
> > informative)
> Bad - if I'm not mistaken, embedded works ok also without user name and
> password. :) Thanks for the report!
> > event handling from java and built in java language support are the
> > other two features I'm interested in (my interest in the second is
> > partly because of the lack of the first). I haven't found anything
> > about them on the Wiki, is there any info about anyone implementing
> > event handling
> Gabriel Reid has already implemented event handling, there is small
issue to
> fix, butevents will be supported in JayBird 2.1, which will be
started right
> after the 2.0 final release. In other words - "comming soon" :)
> > or how java procedural language is progressing?
> Will be released soon in Fyracle project. The integration into the main
> trunk is not yet planned, but actively discussed (though in Russian
> mainly) - we're not yet settled on some basic concepts for external
> procedures in general.
> Roman