Database Server

Reference documentation for Database Server object

Overview

A Database Server represents a connection to a data source object. It consists of connection parameters, various configurations to control behavior and metadata.

File Structure

The properties for Database Server connections are stored under the installation folder in servoy.properties file.

Properties Summary

The following properties can be configured for a Database Server object:

PropertySummary

The identifying name of the Database Server connection.

The host name where your database server can be found.

Postgres database name to connect to.

User name for connecting to the database.

Password to use when connecting to the database.

URL of the JDBC connection to the DB.

JDBC driver to use.

The specific catalog to connect to. Not all databases support this option.

The specific schema to connect to. Not all databases suuport this option.

Determines the maximum number of connections that will be made to the database simultaneously.

Determines the maximum number of unused connections that are in the pool.

Idle connections from the connection pool will be disposed of if they are not used for this given amount of time (minutes).

This setting determines how many prepared statements are kept in cache.

Specifies a way to determine if a DB idle connection leased from the connection pool is valid or not.

The query that must run successfully in order for the connection to be considered valid.

This setting allows marking a Database Server as a clone of another Database Server.

Specifies whether or not the database is enabled.

Specifies whether or not System Tables and Views from the database are to be exposed in Servoy.

Servoy will prefix the table in the sql when needed.

This setting defines if the Database Server is the Log server.

Log table name.

Specifies whether server should expose stored procedures from the database.

Enabling this will set this server to only have client defined connections.

Options for ignoring case when sorting.

Options for setting sorting of null values.

Properties Details

The following properties can be configured for a Database Server object:

Server name

The identifying name of the Database Server connection. This name will be used in various bindings and programmatically, so it should not change. It does not need to match the name of the underlying database.

Type String

Required: true

Sample

example_data

Host Name

The host name where your database server can be found.

Type String

Required: true

Sample

localhost

Database Name

Postgres database name to connect to.

Type String

Required: true

Sample

example

User Name

User name for connecting to the database.

Type String

Required: true

Sample

DBA

Password

Password to use when connecting to the database.

Type String

Required: true

Sample

******

URL

The JDBC URL through which the database can be accessed.

Type String

Required: true

Sample

jdbc:postgresql://localhost:5432/example

Driver

JDBC driver to use. Each DB type has a different driver. For some DB types there are multiple drivers available. This is the name of a driver class that is located in the driver directory's jar files.

Type String

Required: true

Sample

org.postgresql.Driver

Catalog

The specific catalog to connect to. Not all databases support this option.

Type String

Required: true

Sample

"<none>"

Schema

The specific schema to connect to. Not all databases support this option.

Catalog & Schema: JDBC defines that a database may have a set of catalog and each catalog may have a set of schema's. However, each database/JDBC driver vendor has interpreted this differently. In general a Catalog contains all the system/metadata tables/views, while the schema contains all the "user" defined tables, views, triggers etc. Within the context of Servoy, the Catalog is hardly used, while the schema setting is used when connection to Oracle.

Type String

Required: true

Sample

"<empty>"

Max Active Connections

Determines the maximum number of connections that will be made to the database simultaneous. If set too low, handling requests towards the database might slow down, as one request needs to wait until another request is processed and the connection is returned to the pool. If set too high, the exceptions might occur if the database cannot handle that many concurrent connections or if more memory is required than is available.

Type Number

Required: true

Sample

30

Max Idle Connections

Active connections that are done processing a request are returned to the connection pool as idle connections. If the number of idle connections goes over the maximum, the connections are removed. As instantiating new connections takes time, the value shouldn't be too low. On the other side idle connections take up resources, so the number shouldn't be too high either. Must be lower that the 'Maximum connections active' setting.

Type Number

Required: true

Sample

10

Connection Idle Timeout

Idle connections from the connection pool will be disposed of if they are not used for this given amount of time (minutes).

Type Number

Required: true

Sample

-1

Max Idle Prepared Statements

All Servoy generated SQL statements are in the form of Prepared Statements, to increase the performance of statement execution. This setting determines how many prepared statements are kept in cache.

Type Number

Required: true

Sample

100

Connection Validation Type

Some databases automatically end connections when they have been idle for a certain period of time. This setting controls if and how Servoy validates a connection leased from the connection pool, before using it. There are three variations:

  • exception validation (value = 0, default): With exception validation no validation occurs before using the connection. When a exception occurs, the connection is destroyed. While this method has no overhead, the downside of this method is that the user is presented with the exception.

  • query validation (value = 1): With query validation, each connection is validated by executing a validation query upon leasing the idle connection from the pool. If the execution of the validation query results in an exception, the connection is destroyed and a new connection is leased from the pool. This process continues, until a connection correctly handles the validation query. The actual validation query can be set using the 'Validation query' setting (see below). This method has the greatest overhead of the three options, because the validation query is fired for every request towards the database.

  • metadata validation (value = 2): With meta data validation the JDBC driver is asked for some metadata about the connection. This method is not as useful on all databases, as some JDBC driver cache the meta data, so they return their result without actual communication with the database itself. In most scenario's the exception validation will be sufficient, as the Servoy Application Server and the Database Server are connected via a reliable network connection (or are hosted on the same machine). Instead of opting in for any of the other validation types, it is advised to solve any connection issues between the Application Server and the Database Server, instead of changing the validation type. Changing the validation type should be the last resort.

  • driver based validation (value= 3, since 8.4): With driver based validation, the connection validation mechanism of the JDBC driver is used; note that this method may send a query to the database server, depending on the driver implementation.

In case of an old (JDBC3) driver the validation will fall back to exception validation.

Type Number

Required: true

Sample

exception validation

Connection Validation Query

The SQL statement fired at the database if the 'Query validation type' is set to 'Query validation'. The SQL statement used should be a statement with as little overhead as possible.

Type String

Required: true, if Connection Validation Type is set as "query validation"

Sample

'SELECT 1'

Data Model Clone From

This setting allows marking a Database Server as a clone of another Database Server. When marked as such, if a Solution is imported on the Servoy Application Server, any updates to the datamodel of the master Database Server are also applied to the Database Servers that are marked as a clone of the master Database Server.

Type String

Required: true

Sample

"<none>"

Enabled

Specifies whether or not the database is enabled.

Type Boolean

Required: true

Sample

"true" or "false"

Skip System Tables

When tables are defined in multiple schemas, whith this option set to 'true', Servoy will prefix the table in the sql when needed.

Type Boolean

Required: true

Sample

"true" or "false"

Prefix Tables

Specifies whether or not System Tables and Views from the database are to be exposed in Servoy.

Type Boolean

Required: true

Sample

"true" or "false"

Log Server

Servoy has functionality that allows to automatically track all insert/updates/deletes on tables. This functionality can be enabled through the Security layer inside the Solution. This functionality relies on one of the enabled Database Servers configured on the Servoy Application Server being marked at 'Log server'. This setting defines if the Database Server is the Log server.

Type Boolean

Required: false

Sample

"true" or "false"

Log Table Name

Log table name.

Type String

Required: true

Sample

"log"

Enable Procedures

Specifies whether server should expose stored procedures from the database. Default value is false except for Progress database where value is true. If set to true, will show stored procedures in solution explorer view and in code completion under datasources. From datasources node can call a stored procedure.

Type Boolean

Required: false

Sample

"true" or "false"

Client-Only Connections

Enabling this will set this server to only have client defined connections (datasources.db.server.defineDatasource()). This tries to postpone also the loading of the tables (only do that with a client connection).

Type Boolean

Required: false

Sample

"true" or "false"

Sort Ignoring Case

Options for ignoring case when sorting, this can be overridden at column level (in the table editor).

Type Boolean

Required: false

Sample

"true" or "false"

Sorting Null-Precedence

Options for setting sorting of null values, this can be overridden at column level (in the table editor). There are 3 options for this setting:

  • Database default

  • Nulls first on sort asc

  • Nulls last on sort asc

Type Number

Required: true

Sample

"Database default"

Last updated