Before you can start using SqueakDBX, you need OpenDBX. You can install openDBX from binaries or you can compile it by yourself. At this point, you should be asking yourself which version to use. Because of this, we have in class OpenDBX a class method called currentOpenDBXVersion that tells you which version you must use. In addition, you can see ChangeLog information. In both cases, you must have installed your database client library first.
First of all, you may be asking yourself what "database client library" means. Each database vendor creates the database engine and then you should open a socket and implement the vendor protocol so that you can communicate to the database. As this is painful and requires a lot of time, vendors give as (programmers) "drivers". This driver are simpler than opening a socket and give us an API to talk to the database. This drivers can be of different programming languages like C, Java (it is called JDBC), etc. ALL vendors provide a driver written in C. This driver, is often called "The database client library". In summary, the database client library is the C database driver :)
The installation depends on the vendor. Sometimes in the same executable you have the server and the client. Sometimes you need to install a separate package for the client.
To install openDBX from binaries, you can find these files in http://www.linuxnetworks.de/doc/index.php/OpenDBX/Setup/Unix-like. The linker searches for the library in its configured paths (/etc/ld.so.conf) or in the directory in LD_LIBRARY_PATH.
You must also install the libopendbx-dev package.
Example of a .deb instalation:
$ sudo dpkg -i libopendbx_1.4.0-1_i386.deb libopendbx-mysql_1.4.0-1_i386.deb
and then:
$ sudo dpkg -i libopendbx1-dev_1.4.0-1_i386.deb
Windows DLLs either have to be in the program directory (i. e. the directory where squeak.exe resides), in a directory in %PATH% or in c:/windows/system32. We recommend the first approach so that to avoid the "dll hell". Just in case you have never been there: http://en.wikipedia.org/wiki/DLL_hell.
You can download dll from here http://www.linuxnetworks.de/doc/index.php/OpenDBX/Setup/Windows.
We are not Mac experts, but we think the easier way to install OpenDBX is Mac is compiling.
You can see here how to compile and install OpenDBX:http://www.linuxnetworks.de/doc/index.php/OpenDBX/Setup/Manual_builds.
What it’s important here is that when you compile OpenDBX, you have to specify the database engines you want. When you do the ’./configure’, OpenDBX will check if you have already installed the client library (component 4 in http://wiki.squeak.org/squeak/6060) for them. So, remember that sometimes this library isn’t in the server packages but in the client one.
If you have a problem compiling OpenDBX or whatever, you can write to the OpenDBX list:https://lists.sourceforge.net/lists/listinfo/libopendbx-devel/. All of us are subscribed to that list, so we’ll see the message and try to help you.
We have prepared a document (It will then be in this wiki) with all the common problems people have when trying to compile openDBX with different backends and OS. You should read (it will be very helpful for you) it from here: http://www.assembla.com/spaces/Proyecto-Proyecto/documents/cW1J8Mx40r3Rq-eJe5afGb/download/openDBXtutorial_v2.0.pdf
Testing (if you compile it)
After compiling and installing OpenDBX, there is a good way to see if everything is working as expected. Go to the directory where you uncompressed OpenDBX. Do cd test and then, for example ./odbxtest -b pgsql -h localhost -p 5432 -d myDatabase -u myUser -w myPass where ’pqsql’ is the specific name for postgres backend. If you compiled it with other backend you must test it with that in particular. This test will create tables, insert, select, update and delete data. Finally, It will drop all tables.
If you have an error executing this test, it means there is a problem with OpenDBX, so you won’t be able to use SqueakDBX till you fix that.
If you try to run any test and you get a ’unable to find function address’ this means FFI doesn’t find the openDBX shared library. In this case, there are some things you can do:
VM_LIBDIR
VM_X11DIR
We also hunt in the .apps resources folder
standard Plugins directory
the current directory ./
the vm directory
and lastly frameworks in
"/CoreServices.framework/Frameworks",
"/ApplicationServices.framework/Frameworks",
"/Carbon.framework/Frameworks",
When SqueakPluginsBuiltInOrLocalOnly is true we only look in
the.apps resources folder
standard Plugins directory
and lastly frameworks in
"/CoreServices.framework/Frameworks",
"/ApplicationServices.framework/Frameworks",
"/Carbon.framework/Frameworks",