Firebird Embedded, anything I am doing wrong ?

Forum related to Firebird

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
nath0rn
Fresh Boarder
Fresh Boarder
Posts: 8
Joined: 06.07.2008, 13:58

Firebird Embedded, anything I am doing wrong ?

Post by nath0rn »

Hey,

I've come across Firebird Embedded and it looks like a rather interesting thing to use, most interesting indeed. :) I've searched around the form and google, but nothing has being of help for this problem.

Although, I seem to be able to get it to execute fine, nothing can connect to it.

Here's what I've done,
[hr]
  • - Dragged a ZConnection onto my form
    - Set the properties of ZConnection

    - Protocol to Firebirdd-2.0, hostname to nothing '', username and password are the generic SYSDBA and masterkey and the path to the database file.
[hr]

I've made a button to start the server, which is ZConnection1.connect; Also I am using version 6.6.3-rc, Delphi 2007.

I have another laptop here, but when I try to connect to the host machine, it fails to establish a connection. Because the target machine actively refused it. How rude !

If I am using the usual Firebird server, everything works fine, so it isn't a firewall problem or anything.

Does anyone know if I am doing anything wrong, or have an example on how to achieve such a feat?

Thankyou for your time,

~ Nathan
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Yes, you'r doing something wrong, I think. :p

If I understand you well, you try to use an embedded server in a client-server way. That will not work...

An embedded server is embedded in the application that uses it. So it's just part of the program running on the first machine. That program can do everything with it's embedded server, just as if it was a normal FB server. However, no other program will be aware of this database server as it only exists INSIDE your program. Thus a program running on a different laptop certainly doesn't know anything about it.

I don't know why you were thinking an embedded server would be better in your case. What you describe looks like a job for the regular FB server.
If you really want to use an embedded server when connections from other machines should be possible you have to write some 'application server'. A program using the embedded database that allows clients to connect and handles their questions. That's a totally different setup and design, however.

Mark
Image
Michael
ZeosLib's Handyman :o)
ZeosLib's Handyman :o)
Posts: 189
Joined: 15.08.2005, 16:08
Location: Wehrheim
Contact:

Post by Michael »

Hi, both of you!

I also tried FB embedded 2.0 earlier this year but failed to connect via ZEOS. So I tried FB embedded 1.5 and it worked as described in the ebedded documentation ...

@nath0rn: Maybe you'll give the older 1.5 version a try. But keep in mind that the database-file has to be located on the local drive wher your application (and the dll's) are placed.

Regards and good night!

<edit>btw: there is an (only) german article about the FB Embedded 1.5 here: http://mseegernet.de/Delphi/FBEmbedded/FBEmbedded.htm</edit>
:prog2: Use the source, dude!

[align=right]..::.. ZeosLib on SourceForge ..::..[/align]
User avatar
cipto_kh
Senior Boarder
Senior Boarder
Posts: 83
Joined: 28.09.2005, 11:22
Location: Indonesia
Contact:

Post by cipto_kh »

I use Zeos for FB 2.0 embed and it worked :)
I never use the firebirddXX protocol for embedded version. Maybe we can move this embed protocol from the protocol list.

Use the normal protocol Firebird-2.0 with "hostname" property set to empty and set the database to your .fdb file or you can also use alias :) (you can use alias if you also have aliases.conf on your embed version directory)
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

No cipto, the 'embedded' protocols have been added to allow the 'embedded server' and the 'normal' dll's to be loaded together.(eg. for synchronisation with a remote server) Technically both implementations are be identical.
These are the only differences for the embedded protocols:

Code: Select all

{ IZFirebirdD20PlainDriver }

function TZFirebirdD20PlainDriver.GetProtocol: string;
begin
  Result := 'firebirdd-2.0';
end;

function TZFirebirdD20PlainDriver.GetDescription: string;
begin
  Result := 'Native Plain Driver for Firebird Embedded 2.0';
end;

procedure TZFirebirdD20PlainDriver.Initialize;
begin
  ZPlainFirebird20.LibraryLoaderEmbedded.LoadIfNeeded;

end;
So it's just the different dll that's loaded.

Mark
Image
User avatar
cipto_kh
Senior Boarder
Senior Boarder
Posts: 83
Joined: 28.09.2005, 11:22
Location: Indonesia
Contact:

Post by cipto_kh »

I forget, I use that trick with rename the fbembedd.dll to fbclient.dll
nath0rn
Fresh Boarder
Fresh Boarder
Posts: 8
Joined: 06.07.2008, 13:58

Post by nath0rn »

Ahh, I see now.

Thanks for your time guys. :) I guess this post is good for any other people eager to know about embedded firebird.

Thanks,

~Nathan
User avatar
cipto_kh
Senior Boarder
Senior Boarder
Posts: 83
Joined: 28.09.2005, 11:22
Location: Indonesia
Contact:

Post by cipto_kh »

@Mark
so the embedded protocol has another capability to handle which .dll should be loaded automatically (between normal .dll or embed .dll)?

@nath0rn
as mark says, I curious why you cann't use the embedded proctocol to connect normally on FB embed version, is it still have a problem now?
nath0rn
Fresh Boarder
Fresh Boarder
Posts: 8
Joined: 06.07.2008, 13:58

Post by nath0rn »

cipto_kh wrote: @nath0rn
as mark says, I curious why you cann't use the embedded proctocol to connect normally on FB embed version, is it still have a problem now?
Ahh, from what I understand is, the firebird embedded version can only be used locally, in the same application, instead of it acting as a server with multiple clients connecting to it from other machines. That's the gist of what I gathered anyway.

I just got excited and thought I could write a nice little server app, but either way things still work out. :)

So it wasn't really a problem, just a misunderstanding.
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

cipto_kh,
Here are the locatons of the loaded dll's :
From ZPlainFirebird20.pas :
WINDOWS1_DLL_LOCATION = 'fbclient20.dll';
WINDOWS1_DLL_LOCATION_EMBEDDED = 'fbclientd20.dll';

LINUX1_DLL_LOCATION = 'libfbclient.so.20';
LINUX1_DLL_LOCATION_EMBEDDED = 'libfbembed.so.20';
LINUX1_IB_CRYPT_LOCATION = 'libcrypt.so.20';

From ZPlainFirebirdDriver.pas :
WINDOWS2_DLL_LOCATION = 'fbclient.dll';
WINDOWS2_DLL_LOCATION_EMBEDDED = 'fbclientd.dll';

LINUX2_DLL_LOCATION = 'libfbclient.so';
LINUX2_DLL_LOCATION_EMBEDDED = 'libfbembed.so';
LINUX2_IB_CRYPT_LOCATION = 'libcrypt.so';
Normal protocol 2.0 uses : WINDOWS1_DLL_LOCATION, or WINDOWS2_DLL_LOCATION
Embedded protocol 2.0 uses : WINDOWS1_DLL_LOCATION_EMBEDDED, or WINDOWS2_DLL_LOCATION_EMBEDDED

Mark
Image
Post Reply