Subject | FBManager Questions |
---|---|
Author | Robert DiFalco |
Post date | 2004-08-19T14:00:15Z |
I have a couple of questions about FBManager. One I think is a bug.
1. When #setForceCreate is true, #createDatabase does not first DROP the
database so secondary files are left; making it impossible to recreate
them. The workaround is to NOT use forceCreate and to instead perform an
explicit #dropDatabase. FBManager#dropDatabase does get rid of the
secondary files.
2. Is there a reason that there is no #isDatabaseCreated method? To work
around the force create problem, I was going to see if the database
already existed, if it did, then #dropDatabase before #createDatabase.
However, there is no #isDatabaseCreated method so I have mocked one up
like this:
private boolean isDatabaseCreated()
{
try
{
DriverManager.getConnection( DB_DRIVER_URL, DB_INFO
).close();
return true;
}
catch ( SQLException e )
{
}
return false;
}
Not the best way to do it, but it seems to work.
If #1 is a bug, I will happily add it to the bug database.
R.
1. When #setForceCreate is true, #createDatabase does not first DROP the
database so secondary files are left; making it impossible to recreate
them. The workaround is to NOT use forceCreate and to instead perform an
explicit #dropDatabase. FBManager#dropDatabase does get rid of the
secondary files.
2. Is there a reason that there is no #isDatabaseCreated method? To work
around the force create problem, I was going to see if the database
already existed, if it did, then #dropDatabase before #createDatabase.
However, there is no #isDatabaseCreated method so I have mocked one up
like this:
private boolean isDatabaseCreated()
{
try
{
DriverManager.getConnection( DB_DRIVER_URL, DB_INFO
).close();
return true;
}
catch ( SQLException e )
{
}
return false;
}
Not the best way to do it, but it seems to work.
If #1 is a bug, I will happily add it to the bug database.
R.