0

I am trying to use the Firebird embeded DB together with Hibernate, but I get the following error when trying to create the database:

Caused by: org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544344. I/O error during "CreateFile (open)" operation for file "D:\DB\FIREBIRD.FDB"
Error while trying to open file
null
    at org.firebirdsql.jdbc.FBDataSource.getConnection(FBDataSource.java:123)
    at org.firebirdsql.jdbc.AbstractDriver.connect(AbstractDriver.java:126)
    at org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl.getConnection(DriverManagerConnectionProviderImpl.java:204)
    at org.hibernate.internal.AbstractSessionImpl$NonContextualJdbcConnectionAccess.obtainConnection(AbstractSessionImpl.java:292)
    at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(LogicalConnectionImpl.java:214)
    ... 32 more
Caused by: org.firebirdsql.gds.GDSException: I/O error during "CreateFile (open)" operation for file "D:\DB\FIREBIRD.FDB"
Error while trying to open file
null
    at org.firebirdsql.gds.impl.jni.JniGDSImpl.native_isc_attach_database(Native Method)
    at org.firebirdsql.gds.impl.jni.BaseGDSImpl.iscAttachDatabase(BaseGDSImpl.java:158)
    at org.firebirdsql.jca.FBManagedConnection.<init>(FBManagedConnection.java:105)
    at org.firebirdsql.jca.FBManagedConnectionFactory.createManagedConnection(FBManagedConnectionFactory.java:490)
    at org.firebirdsql.jca.FBStandAloneConnectionManager.allocateConnection(FBStandAloneConnectionManager.java:69)
    at org.firebirdsql.jdbc.FBDataSource.getConnection(FBDataSource.java:120)
    ... 36 more

What I have done until now:

  1. I've set the hibernate configuration.
    Driver = "org.firebirdsql.jdbc.FBDriver",
    Dialect = "org.hibernate.dialect.FirebirdDialect",
    Url = "jdbc:firebirdsql:embedded:D:\DB\FIREBIRD.FDB",

  2. I have added the jaybird-full jar to my classpath.

  3. I have added jaybird22.dll, fbembed.dll (the whole folder) to my path.

The dlls seem to be loaded since if I delete the dlls I get and exception telling me that jaybird22.dll cannot be found.

Any idea what could be wrong ?

1
  • I assume D:\DB exists and you have the permission to create files in it. try jdbc:firebirdsql:embedded:D:/DB/FIREBIRD.FDB. Can you use the database without using hibernate? Commented Jun 13, 2013 at 0:03

1 Answer 1

1

It seems the step I was missing was creating the database file manually:

FBManager manager = new FBManager(GDSType.getType("EMBEDDED"));
manager.start();
manager.createDatabase(myDbFile, username, password);
manager.stop();
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.