Subject more on getting embedded ... RE: [Firebird-Java] Once again ... Re: Firebird Embedded deploying with Java
Author palmer ristevski
Hi Roman,

A while back you gave me some code for Client-Server and Emebedded :
See below :

***************************************************
FBManager m = new FBManager();
m.setServer(host);
m.setPort(3050); //optional
m.start();
// recreate if db exists
m.setForceCreate(true);
m.createDatabase(path, user, password);
m.stop();

for embedded:

FBManager m = new FBManager("EMBEDDED");
m.start();
// recreate if db exists
m.setForceCreate(true);
m.createDatabase(path, user, password);
m.stop();
*******************************************************

The Client-Server stuff worked well.

I had problems with embedded, but i knew it was me not understanding which files i needed, and just general
now knowing the ideas for embedded operation properly.

You helped me out again by telling me I need the following files :
"In order to use fbembed.dll you need jaybird-x.x.x.jar and jaybirdXX.dll."

And you told me to look up some of the release notes :

Roman said :
"Also you can check "Using Type 2 and Embedded Server driver" in release

notes (beginning from page 11 in PDF) - if there are unclear parts,

please ask questions here and/or help to formulate them better."

Now with my research, I have come to the conclusion that the documentation is not clear.
There is documentation in the release notes but it addresses the COM-developer using VB or VC++,
not the Java guy.

I found some other developer forum site saying that you need many more files, see here :

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
http://forums.devshed.com/firebird-sql-development-61/newby-question-java-application-with-firebird-embedded-256848.html


I had solved the problem.

copy fbembed.dll without renaming it to the java application root directory. Also copy firebird.conf, firebird.msg and intl directory.

Then, in the database URL write something like this: "jdbc:firebirdsql:embedded:c:\\data\\testdb.fdb"

It should work...

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

Also with a colleague of mine we were wondering if for embedded mode we need to use a different string than
this one:
"org.firebirdsql.jdbc.FBDriver", this can from code from documentation below:



// The newInstance() call is a work around for some

// broken Java implementations



Class.forName("org.firebirdsql.jdbc.FBDriver").newInstance();



}

catch (Exception E) {

System.err.println("Unable to load driver.");

E.printStackTrace();

}




I also found this :(but does not seem to talk to Java dev)
http://www.firebirdsql.org/manual/ufb-cs-embedded.html#ufb-cs-embedded-windows


Also anther problem is that when I put the JayBird.jar file in the class path in NetBeans IDE,
I don't seem to be able to put the .dll files in the class path. But I put the .dll files in the same
directory as the .jar file.


SO in the end you see the documentation on getting EMBEDDED mode working is all over the place.
It is difficult to get all the information one needs in one place.


Has anybody made an effort to put all the steps required to get embedded mode of Firebird working,
on a blog site or something.

If I ever get this working I will write out a document in detail and share it with everyone.


Regards,


Palmer





To: Firebird-Java@yahoogroups.com
From: roman@...
Date: Tue, 7 Apr 2009 17:59:24 +0200
Subject: Re: [Firebird-Java] Once again ... Re: Firebird Embedded deploying with Java





















> So even if one was to not use it in embedded mode,

> my question is still whether the Jaybird JAR file

> is a total re-write of Firebird database engine in Java

> hence it is all in this file.



No, it is not. jaybird-x.x.x-full.jar is a JAR that contains also

dependent libraries for those that have simple setup, want to take a jar

file and do not bother themselves with other dependencies. Can lead to

lib conflicts.



> OR is is just a driver to connect to the FireBird engine

> which is just a ".dll" file.



In order to use fbembed.dll you need jaybird-x.x.x.jar and jaybirdXX.dll.



> Once again I wish to know what files

> are important to just get started.



What about reading "Distribution package" chapter from release notes

(page 8 in PDF)?



Also you can check "Using Type 2 and Embedded Server driver" in release

notes (beginning from page 11 in PDF) - if there are unclear parts,

please ask questions here and/or help to formulate them better.



Roman




















_________________________________________________________________
Hotmail: Trusted email with powerful SPAM protection.
http://clk.atdmt.com/GBL/go/177141665/direct/01/

[Non-text portions of this message have been removed]