I am not sure if it will work for you.. but here goes.
I use ubuntu, and when I read the docs it says that I DON"T have to use the config context for the driver ..since JDBC is already available to use with java.sql package
Example ::
import java.nio.channels.SocketChannel;
import java.util.LinkedList;
import java.util.Vector;
import it.gotoandplay.smartfoxserver.SmartFoxServer;
import it.gotoandplay.smartfoxserver.data.*;
import it.gotoandplay.smartfoxserver.extensions.AbstractExtension;
import it.gotoandplay.smartfoxserver.extensions.ISmartFoxExtension;
import it.gotoandplay.smartfoxserver.lib.ActionscriptObject;
import it.gotoandplay.smartfoxserver.events.*;
import org.json.*;
import java.sql.*;//*the class you need for mysql fun
public class FunRoom extends AbstractExtension implements ISmartFoxExtension
{
private static Zone _zone;
private static Room _room;
@Override
public void init()
{
_zone = SmartFoxServer.getInstance().getZone("FunFactory");
Connection con = null;
try
{
Class.forName("com.mysql.jdbc.Driver");
con = DriverManager.getConnection("jdbc:mysql://x.x.x.x:3306/bingo?user=foouser&password=foopassword");
if(!con.isClosed())
{
trace("Successfully connected to " + "MySQL server using TCP/IP...");
Statement s = con.createStatement ();
s.executeQuery ("MySQL STATMENT HERE");
ResultSet rs = s.getResultSet ();
while (rs.next ())
{
String _room_name = rs.getString("room_name");///as example only... pull whatever data as a test.
}
rs.close();
s.close();
con.close();
}
}
catch(Exception e)
{
trace("Exception::: "+ e.getMessage());
}
finally
{
try
{
if(con != null)
con.close();
}
catch(SQLException e)
{
trace("Exception::: "+ e.getMessage());
}
}
}
private void info(String msg)
{
SmartFoxServer.log.info(msg);
}
@Override
public void handleInternalEvent(InternalEventObject evt)
{
// TODO Auto-generated method stub
}
@Override
public void handleRequest(String arg0, ActionscriptObject arg1, User arg2,
int arg3)
{
// TODO Auto-generated method stub
}
@Override
public void handleRequest(String _command, JSONObject jso, User _user,
int _roomId)
{
}
@Override
public void handleRequest(String arg0, String[] arg1, User arg2, int arg3) {
// TODO Auto-generated method stub
}
}
NOTES:
1. I deleted the internal copy of jre of sfs and symbolically linked pointed to the jre folder of the system
2. mysql-connector-java-5.1.13-bin.jar goes in the {SYSTEM}/jre/lib/ext folder...no where else.
3. for ubuntu using apt-get I had the following packages installed>
openjdk-6-jdk
sun-java6-jre
sun-java6-plugin
sun-java6-bin
sun-java6-jdk
sun-java6-source
sun-java6-fonts
java-common
I am not sure what it is to install it on MAC OS.. but since it is a bastard child of freebsd.. I am sure there is a similar method downloading the package for MAC distribution via the MAC repos.... (hit me if I saying crazy talk)
4. PAPER-ROCK-SCISSORS:::If you are concerned with possibly making mistakes... as they will occur... make sure you have a back-up of the original jre folder just in case nuts and bolts fly everywhere..
5.FINAL NOTE: as a "SANITY" test .. I first compiled a java exectutable with (with a main stub) to test to see if the db runs locally(or elsewhere)
import java.sql.*;
public class jdbc {
public static void main(String[] args) {
Connection con=null;
Class.forName("com.mysql.jdbc.Driver").newInstance ();
con = DriverManager.getConnection("jdbc:odbc:x","root"," xyz");
Statement stmt = con.createStatement();
ResultSet result =stmt.executeQuery("select * from");
while(result.next())
{
System.out.print(result.getString(0));
}
}
}
have fun... should you choose to accept this mission....

Abyssus abyssum invocat,Ad hominem Ad Libitur..Non Conserva me ab animam inferno...liberate tutame ex inferis