Subject | Re: [Firebird-Java] Can I execute CREATE DATABASE via JayBird API? |
---|---|
Author | Roman Rokytskyy |
Post date | 2007-01-17T10:35:46Z |
> I knew that I can execute CREATE DATABASE with C API isc_dsql_execute_immediate.The isc_dsql_execute_immediate does not work for CREATE DATABASE in
> # On InterBase API Guide Beta p.327
>
> Can I execute CREATE DATABASE via JayBird API ?
> or is there any method to create DB via Java?
Jaybird. isql/client library parse the call and extract the host name
and database path and call the isc_create_database method, Jaybird does
not parse the SQL.
Jaybird has appropriate class org.firebirdsql.management.FBManager which
does the task:
FBManager fbManager = new FBManager("PURE_JAVA");
fbManager.setServer(DB_SERVER_URL);
fbManager.setPort(DB_SERVER_PORT);
fbManager.start();
fbManager.setForceCreate(true);
fbManager.createDatabase(DATABASE_PATH, DB_USER, DB_PASSWORD);
Roman