After unpacking the ZIP file, a directory sqlspaces should have been created. Within this folder you can find starting scripts for Linux (startServer.sh) and Windows (startServer.bat). However, before starting the server, you should have a look at the configuration. Most of the values are default values, that should work without changing, but some of them might be interesting for you. The values are ordered hierarchically by the well known dot notation. You can change these settings in different ways, but in all cases you change the values of the following key-value pairs (this is the current default configuration):
db.connectionpoolsize = 80 db.querylimit = 100000 db.hsql.destination = memory db.hsql.fieldsize = 4 db.host = localhost db.port = 3306 db.schema = sqlspaces db.user = sqlspaces db.password = sqlspaces db.type = HSQL log.filename = server.log log.level = OFF log.toconsole = true rightsmanagement.admins = rightsmanagement.enabled = false rightsmanagement.spectators = server.localmode = false server.non-ssl.port = 2525 server.non-ssl.enabled = true server.ssl.port = 2530 server.ssl.enabled = false server.shell.port = 2540 server.shell.enabled = false server.web.enabled = true server.web.port = 8080 server.web.root = . server.remote-admin.enabled = true server.remote-admin.port = 2535 server.xmpp.host = localhost server.xmpp.enabled = false server.xmpp.port.external = 5275 server.xmpp.port.client = 5222 server.xmpp.service.name = sqlspaces server.xmpp.service.secret = sqlspaces
The meaning of the single lines are as follows:
There are the following three ways of setting the values:
The configuration file is called sqlsconfig.properties and is parsed once during startup, so later changes will not effect running servers. The file is a simple properties file, i.e. it contains plain text and has in each line a name-value-pair that is connected with a ``=''.
If you want to change the name or location of the config file, you can do that by setting the system property "sqlsconfig". You can do that either in Java by System.setProperty("sqlsconfig", "/home/stefan/default-sqlsconfig.properties"); or (and that is actually intended) by passing it as a command-line argument, i.e. java myPackage.myApplication -Dsqlsconfig=/home/stefan/default-sqlsconfig.properties . Please be aware that the programmatic approach (with System.setProperty(...)) only works, if you set the property before the first invocation of any SQLSpaces code. Otherwise the configuration has already been initiated.
You can also override the default settings by defining global variables. This is either done on an OS level or by adding them to the commandline call of the server. In both cases, you have to put "sqlspaces." before the keys. If you for instance want to set the database type for your application (that is in contained in an executable jar) via commandline parameter, you have to start your program like that:
java -Dsqlspaces.db.type=PSQL -jar MyApplicationsJar.jar
Especially if you start the server from within a Java process (and not by simply using the startup script), you can change all settings by calling methods on the internal configuration class (info.collide.sqlspaces.commons.Configuration). This class has a static getInstance() method, that returns the configuration singleton. As long as these values are changed before the start of the server (Server.startServer()), they are used.