Servoy utilizes a three tier architecture for database access: Clients communicate with the Servoy Application Server and the Application Server communicates with the database.

For each defined database, the Servoy Application Server manages a pool of database connections, the size of which is configurable.

The Application Server connects to databases through JDBC , a universal Java technology for Java applications to communicate with SQL databases.

JDBC Drivers

In order to be able to connect to a database, the Servoy Application Server requires a JDBC Driver.

Servoy ships drivers for a several databases. For a full overview of the JSBD drivers shipped with a specific Servoy version, check the Servoy Stack info page in the Programming Reference Guide for the Servoy version used. 

The JDBC drivers are stored in the ../application_server/drivers/ directory.

Additional JDBC Drivers can be manually placed in this directory or can be uploaded through the Upload Library section of the Servoy Admin page. In both scenario's the Application Server requires a restart.

(warning)  While one database is more strict than the other, it is important to use the correct version JDBC Driveror a specific version of the database. Notably Oracle is very strict: even using the JDBC driver of another minor version might cause unexpected results! Refer to the documentation of the database vendor for the correct JDBC driver.

The oraclelobfix.jar file in the drivers directory is not an Oracle JDBC driver, but a library containing a fix for an issue in the Oracle JDBC driver. When connecting to Oracle databases, it's still required to add the correct Oracle JDBC driver so the Servoy Application Server installation.

Configuring database access

Access to databases can be configured through Database Servers section of the Servoy Admin page and are stored in the servoy.properties file.

In order to connect the Servoy Application Server to a database, the following information is required:

Property

Description

Required

Comment

Server name

 

Yes

 

User name

 

Yes

 

Password

 

Yes

 

URL

 

Yes

 

Driver

 

Yes

 

Catalog

 

Depends

 

Schema

 

Depends

 

Max. Connection Active

 

Yes

 

Max. Connections Idle

 

Yes

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Connection Pooling configuration 

Servoy relies on SQL databases for data storage. Servoy is database agnostic and can connect to any database that supports JDBC.

Connections to databases are configured on the Servoy Application Server and the Servoy Application Server will automatically create a pool of connections.

Clients never directly connect to a database, but instead connect to the Servoy Application Server, which handles the  

Connection Pooling

JDBC drivers

connection pooling works like this
at the moment a client (smart or web) does a query, it takes one from the pool if there is 1 idle (if not it will create one)
then if it is done it puts it back into the pool and it keeps idle connections until the max idle count 

Besides that you also have a max number of connections that are in use.. If that is reached then the next one cant get a connection until another releases one (gives it back as idle)

I think idle of 10 connections is fine for most useage, but do set the max number of connections a bit higher to handle peak connections
What exactly the right thing is is a bit hard to say maybe if you say that you can have max 100 users at the same time
you should have 50 max number of connections and 20 idle...
(so max is users/2 and idle could be users/5)

But this is also a bit depending on your solution, if you use long transactions for example then the max number should be users/1 ....