Tag Archives: database

Custom Room Storage with SFS2X 2.18

Since the release of SmartFoxServer 2.18 we have introduced a way to override the default implementations for the Room Persistence API so that they can be customized to your needs.

Prior to this release we provided a file-based and a relational database-based storage mechanisms that could be used in conjunction with the API to save the state of multiple active Rooms.

With the new release you can now create your own storage implementations and plug them into the Persistence API. In this short article we’ll walk you through what has changed and how you can create a custom storage class.

Continue reading

Using a database in Overcast (part 3)

In the third (and last) part of this series we are taking a look at using the JDBC API to access a database via SFS2X Extensions. While this approach takes a bit more coding compared to the DBManager API (which we have explored in part 2) it also provides more sophisticated features such as working with metadata and advanced data types.

Continue reading

Using a database in Overcast (part 2)

In the previous installment of the this tutorial we have learned all the steps to create a database server in Overcast and connect to it from an existing SFS2X instance.

In this new chapter we are going to explore the database API that can be used to query the database from server side, using SFS2X Extensions.

If you are new to server side coding we highly recommend to get started with this article from our documentation, before proceeding with the rest of the tutorial.

Continue reading

Using a database in Overcast (part 1)

In this new article in the series dedicated to Overcast, the cloud solution for SmartFoxServer 2X, we will describe how to use a database server alongside SmartFoxServer.

In this first part of the article we will focus on launching the database, populating it with some test data and configuring SmartFoxServer to connect to it. In the second and third parts we will deploy an Extension in SmartFoxServer to test the connection with a query.

Continue reading

How to setup a connection to an external Database

SFS2X allows connecting to databases in a way that is very similar to its predecessor. All you need to do is downloading the JDBC connector from your Database vendor (e.g. MySQL or MSSQL) and drop the .jar in the {SFS2XRoot}/lib/ folder.

Of course if you use ODBC instead of JDBC you can even skip the driver deployment step. In fact the ODBC driver is already provided by the Java Runtime.

The following is a list of pages where you can find the JDBC drivers for the most common RDBMS:

The next step is running the SFS2X AdminTool, launch the Zone Configurator module, select your Zone and finally click on the Database manager tab to edit the configuration.

db setup dialog

At the end of the process click Submit and restart the server.