Friday, November 25, 2005

Connect to Firebird embedded, two faces of the same coin

I'm doing some experiments with Firebird 2.0 beta 1 embedded and I found out some "interesting "features:

1. You can connect to an embedded Firebird database through ODBC
1.1 This connection works even if you are connecting to a read-only database file places on a "web folder" (a webdav share mounted in windows)
1.2 For this to work you need to copy fbembed.dll to c:\windows\system32 and rename it to GDS32.DLL

2. You can also connect to an embedded Firebird database through JDBC
2.1 For this to work you need to:
2.1.1 Place JDBC driver (jaybird-full-2.0.0.jar in my case) in your classpath
2.1.2 Place jaybird2.dll somewhere in java.library.path (which usually contains c:\windows\system32)
2.1.3 Do the same for fbembed.dll and the standard (client) GDS32.DLL

3. This makes clear that ODBC and JDBC connections to firebird embedded don't get together easily ... even if the solution is clear.

4. There are some small incompatibilities between Firebird 2 beta 1 and Jaybird 2.0.0

Saturday, November 05, 2005

Commented my.ini file

Commented my.ini file

While at Devshed Forums I noticed the need for an example my.ini (or my.cnf) file with all available options set and proper comments.
Infact, while some commented examples are provided by MySQL AB and some others can be found on the net, I think that there is not an attempt to collect all available options into one file.
This is my try ... please note that this is work in progress!!

[client]
#under this section you’ll find all client parameters

#by setting this your mysql client (tipically the command line tool) will connect using this username as default
user=pippo3
#by setting this your mysql client (tipically the command line tool) will connect using this password as default
password=pippo3

#client will connect to server using this port as default
port=3306

#example of variables that need to be set to obtain SSL encrypted connections between client and server, these are the client settings of course
#SSL certificate of the Certification authority
ssl-ca=C:/CA/CAcert.pem
#SSL certificate of client
ssl-cert=C:/CA/temp/mysql_client/client.pem
#SSL key of client
ssl-key=C:/CA/temp/mysql_client/client.key

#max allowed packet size useful if you need to run large scripts
#the client's default max_allowed_packet value is 16MB
#to use something bigger you'll have to set it on server and client
max_allowed_packet=32M

[mysqld]
#under this section you’ll find all server parameters

#max allowed packet size useful if you need to run large scripts
#The server's default max_allowed_packet value is 1MB
max_allowed_packet=32M

#turn off autocommit
#this makes MySQL behave like Oracle and other databases, you'll have to commit to save data
#note that if a user has SUPER privilege init_connect will NOT execute (because if init_connect
#contains a wrong query connection will close). What a stupid solution.
init_connect='SET AUTOCOMMIT=0'

#Path to the database root
#change this if you want to relocate data to a new directory for MyISAM (table definitions and data) and InnoDB (table definitions)
datadir="D:/MySQL DataDir/"

#some examples of variables that influence full text indexing and search
#minimum word length considered
ft_min_word_len=1
#country specific stopword file
ft_stopword_file=C:/mysql/stopwordfiles/italianST.txt

#example of variables that need to be set to obtain SSL encrypted connections between client and #server
#SSL certificate of the Certification Authority
ssl-ca=C:/CA/CAcert.pem
#SSL certificate of server
ssl-cert=C:/CA/temp/mysql_server/server.pem
#SSL key of server
ssl-key=C:/CA/temp/mysql_server/server.key

# The default storage engine that will be used when you create new tables
#Doesn't work witn MySQL 5.1.5 (bug!)
default-storage-engine=INNODB

# change this if you want to relocate InnoDB datafiles to a new directory
innodb_data_home_dir="D:/MySQL InnoDBDatafiles/"

#change this if you want to relocate InnoDB transaction logs to a new directory
innodb_log_group_home_dir="D:/MySQL InnoDBLogfiles/"