Subject | Re: How is it possible to change Page_Size to 2048 ? |
---|---|
Author | Ashok122 |
Post date | 2006-11-14T18:53:43Z |
Gabriel,
I knew that I could change PageSize just before Restore.
If you use iSQL,
you can send
(so that it does not use the DEFAULT PAGE_SIZE).
I want to know if it is possible to do same thing, but in Java.
My other question is that
can I send CREATE DATABASE statement from Java is the database does
not yet exist?
Thanks,
Ashok
--- In Firebird-Java@yahoogroups.com, Gabriel Reid <gabriel.reid@...>
wrote:
I knew that I could change PageSize just before Restore.
If you use iSQL,
you can send
> > Create Database 'NewDB.fdb' user 'sysdba' password 'masterkey'in above case, we are creating new Database with specified Page_Size
> > page_size 2048
(so that it does not use the DEFAULT PAGE_SIZE).
I want to know if it is possible to do same thing, but in Java.
My other question is that
can I send CREATE DATABASE statement from Java is the database does
not yet exist?
Thanks,
Ashok
--- In Firebird-Java@yahoogroups.com, Gabriel Reid <gabriel.reid@...>
wrote:
>
> On Mon, Nov 13, 2006 at 08:51:25PM -0000, Ashok122 wrote:
> > I want to do this in Java.
> >
> > But I am not sure about getting a Connection object without Database
> > is first created.
> >
> > Because it is possible to use executeUpdate with
> > Create Database 'NewDB.fdb' user 'sysdba' password 'masterkey'
> > page_size 2048
> >
> > before I can use above statement, I need to get the Connection to the
> > database which does not yet exist.
> >
> > or
> >
> > If someone knows how to do this using Service API / FBBackupManager, I
> > would appreciate the Source Code example.
> >
>
> You can indeed do it with the FBBackupManager. The following code should
> do it:
>
> BackupManager mgr = new FBBackupManager();
> mgr.setUser("sysdba");
> mgr.setPassword("masterkey");
> mgr.setHost("somehost");
> mgr.setVerbose(true);
> mgr.setLogger(System.out);
> mgr.setDatabase("/path/to/db.fdb");
> mgr.setBackupPath("/tmp/backed_up.fbk");
> mgr.backupDatabase();
> mgr.setRestorePageSize(2048);
> mgr.setRestoreReplace(true);
> mgr.restoreDatabase();
>
>
> - Gabriel
>