Connecting to database(s)

The CrossmarX Application Engine is able to connect to most common RDBMS products, like Oracle, SQLServer, MySQL, Postgress, etc. And other databases like SQLite and Derby

The name of the database(s) that is/are used by your application, are provided by CrossmarX. You are free to choose the location of the database(s), as long as the databases are accessible through the network.

If the RDBMS uses named users (almost all do), a database user should be created with sufficient rights:

  • If the application only reads data from the database, read rights are sufficient (SELECT).
  • If the application alters data, write rights are also needed (UPDATE, INSERT, DELETE).
  • If you want the CrossmarX Application Engine to create and maintain the database structure automatically, additional rights concerning the Data Definition Language are necessary (CREATE, ALTER, DROP and INDEX).

Next open the file environment.properties in the directory etc and add the following entries:

  • database.product: the database type (mysql, oracle, postgresql, ...)
  • database.driver: the driver to be used
  • database.urlprefix with value: the url to the RDBMS
  • database.user with value: the login name of the database user
  • database.password with value: the password of the database user

The content could look like this:

database.product=mysql
database.driver=com.mysql.jdbc.Driver
database.urlprefix=jdbc:mysql://localhost:3306/
database.user=scott
database.password=tiger

Testing

Open a browser and go to the engine panel:

http://YOUR_HOST:YOUR_PORT/engine?service=engine
Login with: login name engine and password crossmarx. Go to "Test database connection". Enter the name of the database and press "Go".

The engine should respond with "Connecting to database succeeded".

Now that the Application Engine runs and the database is connected, we can start your application. Open a new browser and go to:

YOUR_HOST:YOUR_PORT/engine

The CrossmarX Application Engine should now respond with the start screen of your application.