Subject | Re: [firebird-python] embedded firebird from fdb |
---|---|
Author | Hamish Moffatt |
Post date | 2014-05-06T11:33:16Z |
On 06/05/14 20:00, Pavel Cisar wrote:
Hi Pavel,Hi,
Dne 6.5.2014 04:35, Hamish Moffatt napsal(a):
> Hi,
> I'd like to use embedded firebird on linux from fdb. This doesn't appear
> to be supported currently. Are there any plans to support it?
There is no such a thing like special embedded Firebird engine on Linux
because Classic works that way by design (embedded was specially created
for Windows where Classic has to work slightly differently). So to get
embedded engine on Linux, simply install Classic and connect without
host specification (using only the database filename). It works just
fine with FDB.
Curiously we have a libfbembed2.5 package on Debian though?
Anyway, I can't get fdb to work without a running server;
$ sudo /etc/init.d/firebird2.5-superclassic stop
[sudo] password for hamish:
[ ok ] Stopping Firebird 2.5 superclassic server...done.
$ python
Python 2.7.3 (default, Mar 13 2014, 11:03:55)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import fdb
>>> c = fdb.connect('/tmp/hamish.fdb')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/fdb-1.4-py2.7.egg/fdb/fbcore.py", line 693, in connect
"Error while connecting to database:")
fdb.fbcore.DatabaseError: ('Error while connecting to database:\n- SQLCODE: -902\n- Unable to complete network request to host "localhost".\n- Failed to establish a connection.', -902, 335544721)
>>>
>>> c=fdb.connect(database='/tmp/hamish.fdb')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/fdb-1.4-py2.7.egg/fdb/fbcore.py", line 693, in connect
"Error while connecting to database:")
fdb.fbcore.DatabaseError: ('Error while connecting to database:\n- SQLCODE: -902\n- Unable to complete network request to host "localhost".\n- Failed to establish a connection.', -902, 335544721)
>>> c=fdb.create_database('/tmp/hamish.fdb')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/fdb-1.4-py2.7.egg/fdb/fbcore.py", line 800, in create_database
"Error while creating database:")
fdb.fbcore.DatabaseError: ('Error while creating database:\n- SQLCODE: -904\n- invalid database handle (no active connection)', -904, 335544324)
Hamish