For JDBC

How it works

JDBC (Java Database Connectivity) is a Java-based technology to access databases, not unlike ODBC. The JDBC provider runs a Java Virtual Machine in which the installed JDBC drivers are loaded. Connections are established and used through the JDBC driver, making an extensive use of the JNI (Java Native Interface) technology.

Any JDBC driver can be used, though only some of them have actually been tested. Some specializations have been made to adapt to some corner cases in the way some JDBC drivers are written or some specificities of some database engines.

Note that the JDBC drivers are not provided by Libgda and must be obtained and installed separately.

JDBC drivers' location

JDBC drivers (".jar" files) are searched for in the following locations:

  1. in each directory or JAR file in the CLASSPATH environment variable (if set)

  2. in the $HOME/.local/share/libgda/config directory (or $HOME/.libgda if if exists and $HOME/.local/share/libgda/config does not)

Connection parameters

To connect to a database, the expected connection parameters are the ones required by the JDBC driver being used, which varies from driver to driver (for more information, refer to each driver's documentation). Thus expects only one argument named "URL" which it passes (without any modification) to the JDBC driver.

However, for some widely used servers (such as SqlServer), Libgda also accepts some parameters like for other database providers (like DB_NAME, HOST, ...). In this case one can either provide these parameters or provide the URL parameter (like for any JDBC provider) to specify a connection to open.