Skip to content

DataSource

DataSource#

The Altibase JDBC driver offers a way to connect to the database with a file that contains connection configurations. Datasource is the set of connection information to a database server in the configuration file.

How to set DataSource#

DataSource is set in the following format to the altibase_cli.ini file.

# comment

[ datasource_name ]
Server=localhost # comment
Port=20300
User=sys
Password=manager

Additional connection properties can be added by writing strings of the "key=value" format in lines.

The JDBC driver searches for the altibase_cli.ini file in the paths of the following order:.

  1. /altibase_cli.ini

  2. $HOME/altibase_cli.ini

  3. $ALTIBASE_HOME/conf/altibase_cli.ini

Connecting with DataSource#

To connect to the server with DataSource, the DSN (DataSouce Name) specified in the altibase_cli.ini file should be specified in a connection URL, instead of the IP address and port number.

The following is an example of a connection URL using a DSN.

jdbc:Altibase://datasource_name
jdbc:Altibase://datasource_name:20301
jdbc:Altibase://datasource_name:20301?sys=user&password=pwd

When specifying a DSN in a connection URL, port or other properties can be additionally specified. If a property specified in the altibase_cli.ini file is duplicately specified in a connection URL, however, the file value is ignored and the connection URL value is used.