Intro

Floreant POS ships with Apache Derby database with sample menu items. This database is embedded database and cannot be accessed from other computer. If you need to connect more computer to one central database you need to setup database server.

Server options

We can use one of the database system.

  • Apache Derby Server
    3.5MB small footprint database suitable for small stores.
  • Postgresql 9.5
    Recommended database for 2 or more terminals.
  • MySQL 5.6

Here we will discuss on Derby server. For Postgresql or MySQL you can find online instructions and when done set terminals in the same way.
💡 Please note the recommended DB version. Other versions may not work properly.

Derby Server Start

If you are in windows operating system enter database/derby-server and click on start-server.bat . In case you are in linux or mac you should run start-server.sh

florenat_db

When it starts you will find a terminal window running and waiting for database connection.

Connect Terminals

We recommend wired LAN connection between terminal. Make sure all terminals are connected and can see database server computer.

Every database has a port number and that must be open in Firewall.

💡 We do not use standard derby port, instead we use 51527 

Our next job is to set following information to every terminal. Here is our default settings.

  • DB type: apache derby server
  • Server: localhost
  • DB name: posdb (change this value as per your configuration)
  • User: app
  • Password: sa

Configure Terminal

In each terminal click on “CONFIGURE DATABASE” button in the login screen. And set database server setting and press test connection. If successful you can save and restart.

Figure 2: Derby Server Configuration

Recreate Database

If you ever need to reset the full system you can recreate the database.

⚡ It will wipe out your existing data. Shutdown POS and take backup of database by copying database folder.

  • Click on “CREATE DATABASE SCHEMA”.
  • If you need sample data say yes.

You will be prompted on success and you are all set.

💡 This is a a known issue that Derby often fails to remove existing data and recreate database. Delete database folder and recreating db should solve the issue. You can also create database in different name.

💡 Create a separate database for training purpose.

Database Access

You can directly access database with DBeaver SQL client.

Create a Connection to Access Data

Follow the steps below to add credentials and other required connection properties.

  1. In the Databases menu, click New Connection.
  2. In the Create new connection wizard that results, select the driver.
  3. On the next page of the wizard, click the driver properties tab.
  4. Enter values for authentication credentials

    From Menu click on Database and select new connection

Database Schema

Download latest ER Diagram from here.

Query on Database

You can now query information from the tables exposed by the connection: Right-click a Table and then click Edit Table. The data is available on the Data tab.

 

 bever