Configuring DatabaseManager using H2 embedded database

Post here all your questions related with the SmartFoxServer iPhone API

Moderators: Lapo, Bax

Jeetesh Bhoria
Posts: 2
Joined: 24 Mar 2010, 16:48
Location: India

Configuring DatabaseManager using H2 embedded database

Postby Jeetesh Bhoria » 24 Mar 2010, 17:17

Hi,

How can we access the H2 embedded database of smart fox server. I have to create a multiplayer game in which I have to pass the user data to the server database and retrieve the data back. I have created the database using H2 admin tool in jdbc:h2:tcp://localhost:9009/sample1. In the document it is written that I have to configure the DatabaseManager using code :

<Zone name="h2db" customLogin="false">
<AutoReloadExtensions>true</AutoReloadExtensions>

<Rooms>
<Room name="Lobby" maxUsers="10" isPrivate="false" isTemp="false" autoJoin="true" />
</Rooms>

<DatabaseManager active="true">
<Driver>org.h2.Driver</Driver>
<ConnectionString>jdbc:h2:tcp://localhost:9009/examples</ConnectionString>

<UserName>sa</UserName>
<Password></Password>

<TestSQL><![CDATA[SELECT COUNT(*) FROM retrocomputers]]></TestSQL>

<MaxActive>10</MaxActive>
<MaxIdle>10</MaxIdle>

<OnExhaustedPool>fail</OnExhaustedPool>
<BlockTime>5000</BlockTime>
</DatabaseManager>

<Extensions>
<extension name="h2db_ext" className="internalDbDemo.as" type="script" />
</Extensions>
</Zone>

But after writing the above code into the config.xml file under <zone>..</zone> I am stuck on the sign-in screen and getting error: zone ='/t/t/t/t/t/t/n/n/t/t/t/t/t' string. Can you tell where should I put this code and how to connect. I am working on Mac OS - Iphone sdk - Objective C. Help would be highly appreciated.
-I have checked running the server on same machine and different machine but was getting the same error.
Jeetesh Bhoria
Software Developer

Return to “iPhone Objective-C API”

Who is online

Users browsing this forum: No registered users and 9 guests