Connecting to the Database

Post here all your questions related with SmartFoxServer Java API

Moderators: Lapo, Bax

pokau
Posts: 13
Joined: 27 May 2009, 19:11

Connecting to the Database

Postby pokau » 27 May 2009, 20:10

Hey SF Fourm,

I'm new to SFS, and I'm in the process of writing a simple Java Extension to do custom user authentication. I have my extension in place, but I'm running into problems when connecting a MySQL DB.

Here's what I've done so far around connecting to db:

- I've downloaded the connect/j extension and placed in the lib/ext directory of the jre within SFS
- My database manager active variable is set to true
- The driver element looks like: <Driver>org.gjt.mm.mysql.Driver</Driver>
- I'm pretty sure my connection string element is correct (ie jdbc:mysql://ipaddres:port/schema)
- My username and password have been verified and reverified

I think that's it.

Every time I start SFS, I get the following error when loading my zone:

DB Manager Activated ( org.gjt.mm.mysql.Driver )
14:31:44.859 - [ SEVERE ] > DbManager could not retrive a connection. com.mysql.
jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

Last packet sent to the server was 0 ms ago.

I'm fresh out of ideas, can someone please help?

Kind regards,

pokaru
orthiac
Posts: 115
Joined: 25 Jun 2008, 10:03
Location: Massachusetts, USA

Postby orthiac » 27 May 2009, 20:54

You may find a couple of things to try after looking over here.

Hope that helps,
- Mike
pokau
Posts: 13
Joined: 27 May 2009, 19:11

Postby pokau » 27 May 2009, 22:00

Aww man, thanks so much for looking into my issue. Turns out I was using the wrong ipaddress. Doh :roll:

Cheers

Return to “Java2SE / Android Client API”

Who is online

Users browsing this forum: No registered users and 15 guests