Database connection setup

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

Post Reply
ramindeja
Posts: 74
Joined: 31 Mar 2008, 17:54

Database connection setup

Post by ramindeja »

Hi,

I would like to get more information about how to setup the JDBC driver for MySQL on my server where SmartFox is installed.

As I read the tutorials and documentations about this topic, there was always a reference to JRE and the JRE/lib/ext folder. Well, I don't seem to have the JRE installed or at least the name is not the same. I have Java on the server and SmartFox works fine. The only path that I could find that had a lib/etc/ was by using the command 'locate' and I got these locations:

/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home/lib/ext
/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext

I know that SmartFox is using the version 1.5.

I also downloaded the JDBC driver: mysql-connector-java-5.1.6-bin.jar.

Can somebody please tell me where do I have to place this driver and are there any other settings that I need to do.

Much appreciated.
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

Using the Mac it's a little more complicated because OSX comes with multiple embedded JREs that use different folders.

The best way to do this is to add a reference to the library in the classpath.
Do the following:

1. copy the library in the Server/lib/ folder
2. edit the start.sh script file and add the lib/mysql-connector-java-5.1.6-bin.jar entry in the classpath

In the file you'll see something like this

Code: Select all

java -cp "./:./sfsExtensions/:lib/activation.jar:lib/commons-beanutils.jar:
simply add the entry between colons (":")

Code: Select all

java -cp mysql-connector-java-5.1.6-bin.jar:./:./sfsExtensions/:lib/activation.jar:lib/commons-beanutils.jar:
save and start the server
Lapo
--
gotoAndPlay()
...addicted to flash games
Post Reply