2 (hopefully fast) Problems
Posted: 03 Apr 2011, 14:55
Hello,
I have 2 problems that i hope can be solved fast:
The first one is about an Extension in java that manages login requests.
i found this documentation: http://www.smartfoxserver.com/docs/docP ... /index.htm
However this is not in java, i managed to recive from a client his nick, password and zone with:
but then how can i send a response that authenticates it?
The second problem is:
i created a database withe the H2 dbms and in the config file i put these strings:
It connects without any problems
Then in the java extension i used the DbManager this way:
after that i simply get the records from the ArrayList and print them, the problem is that everything i print is null. The database is filled with some data and the query on the dbtool returns some records, so what i'm missing?
Thanks
I have 2 problems that i hope can be solved fast:
The first one is about an Extension in java that manages login requests.
i found this documentation: http://www.smartfoxserver.com/docs/docP ... /index.htm
However this is not in java, i managed to recive from a client his nick, password and zone with:
Code: Select all
if(ieo.getEventName() == "loginRequest")
{
String username = ieo.getParam("nick");
}
The second problem is:
i created a database withe the H2 dbms and in the config file i put these strings:
Code: Select all
<DatabaseManager active="true">
<Driver>sun.jdbc.odbc.JdbcOdbcDriver</Driver>
<ConnectionString>jdbc:h2:~/mydatabase</ConnectionString>
<UserName>user</UserName>
<Password>password</Password>
<TestSQL><![CDATA[SELECT COUNT(*) FROM USERS]]></TestSQL>
<MaxActive>10</MaxActive>
<MaxIdle>10</MaxIdle>
<OnExhaustedPool>fail</OnExhaustedPool>
<BlockTime>5000</BlockTime>
</DatabaseManager>
Then in the java extension i used the DbManager this way:
Code: Select all
DbManager dbm = new DbManager("sun.jdbc.odbc.JdbcOdbcDriver", "jdbc:h2:~/mydatabase", "username", "passwod", "myZone", 10, 10, "fail", 5000);
ArrayList al = dbm.executeQuery("SELECT * FROM users");
Thanks