How to create a database from Java using FB embedded?

You don't need to use isql, gbak or any external too. There is a class provided by Jaybird called

Here's an example how to use it:

FBManager manager = new FBManager("EMBEDDED");
manager.createDatabase("/path/to/database_file.fdb", 'usr', 'pwd');

First parameter is the database filename, and second and third parameters are username and password. Since username and are not checked by Firebird (at least on Windows version of embedded), you can provide any two strings.

Do you find this FAQ incorrect or incomplete? Please e-mail us what needs to be changed. To ensure quality, each change is checked by our editors (and often tested on live Firebird databases), before it enters the main FAQ database. If you desire so, the changes will be credited to your name. To learn more, visit our add content page.

All contents are copyright © 2007-2023 unless otherwise stated in the text.

Links   Firebird   News   FlameRobin   Powered by FB: Home Inventory   Euchre  
Add content   About  

 Installation and setup
 Backup and restore
 Connectivity and API
 Errors and error codes