Version

    Database Connection Properties

    The Database Connection Properties dialog lets you configure particular properties of a database connection. In the dialog, you can choose a JDBC driver or an existing JNDI resource, set up credentials, transaction isolation level, etc.

    You can create a database connection that uses a user-defined JDBC Driver or a JNDI Resource.

    JDBC driver

    JNDI resource

    JDBC driver

    Basic Properties of JDBC driver

    Microsoft Access

    Advanced Properties of JDBC driver

    The dialog consists of two tabs: Basic properties and Advanced properties.

    Basic Properties of JDBC driver

    In the Basic properties tab of JDBC driver in the Database connection dialog, you specify the name of the connection, type your User name, your access Password and URL of the database connection (hostname, database name or other properties).

    The password can be encrypted using Secure Graph Parameters.

    JDBC Specific

    The default JDBC specific can be used, but the specific one might suit your purpose better. By setting JDBC specific, you can slightly change the behavior of the connection such as different data type conversion, getting auto-generated keys, etc.

    Database connection is optimized according to this attribute. JDBC specific adjusts the connection for the best cooperation with the given type of database.

    You can also choose from the following connections built in CloverDX: Microsoft SQL Server (for Microsoft SQL Server 2008 or newer or Microsoft SQL Server 2000-2005 specific), MySQL, Oracle, PostgreSQL, Sybase and SQLite.

    After selecting one of them, you can see in the connection code one of the following expressions: database="MSSQLSERVER", database="MYSQL", database="ORACLE", database="POSTGRE", database="SYBASE" or database="SQLITE", respectively.

    db connection 0310
    Figure 185. Database Connection Properties Dialog
    Adding JDBC Drivers and Jars

    If you want to use some other driver, you can use one of the Available drivers. If the desired JDBC driver is not in the list, you can add it by clicking the Load driver from JAR sign located on the right side of the dialog (Load driver from JAR). Then you can locate the driver and confirm its selection.

    If necessary, you can also add another JAR to the driver classpath (Add JAR to driver classpath). For example, some databases may need their license to be added as well as the driver.

    JDBC Drivers

    CloverDX has built-in JDBC drivers for: Microsoft SQL Server 2008 or newer, MySQL, Oracle, PostgreSQL, SQLite and Sybase databases. You can choose any JDBC driver from the list of available drivers.

    Since version 5.10.0, Microsoft SQL Server uses Microsoft JDBC Driver library. The former driver (using jTDS library) has been renamed to Microsoft SQL Server Legacy.

    By clicking any driver, a connection string hint appears in the URL text area. You only need to modify the connection.

    You can also specify JNDI.

    Remember that CloverDX supports JDBC 3 drivers and higher.

    Once you have selected the driver from the list, you only need to type your username and password for connecting to the database. You also need to change the hostname to its correct name. Type the right database name instead of the database filler word. Some other drivers provide different URLs that must be changed in a different way.

    You can also load an existing connection from one of the existing configuration files.

    You can set up the JDBC specific property, or use the default one; however, it may not do all that you want. By setting JDBC specific you can slightly change the selected connection behavior such as different data type conversion, getting auto-generated keys, etc.

    Database connections are optimized based on this attribute. JDBC specific adjusts the connection for the best cooperation with the given type of database.

    Note that you can also remove a driver from the list in the Basic tab (Remove selected) and custom properties in the Advanced tab (Remove parameter(s)) by clicking theMinus sign on the respective tab.

    Microsoft Access

    This driver internally uses the UCanAccess driver. CloverDX uses version 4.0.2. See the offical UcanAccess webpage.

    • In DatabaseWriter, long type cannot be used in input metadata. Consider using Map in your graph to convert long fields to other metadata types.

    • boolean fields that are null will be actually written as false (null value is not supported).

    • You cannot write null into binary fields, either.

    • By default, CloverDX uses the singleconnection=true property of the UCanAccess driver to minimize usage of system resources. This default can be overridden in connection URL or in Custom JDBC properties. For more details on driver properties, see the driver’s documentation.

    MS Access data type NUMBER with field size INTEGER corresponds to SQL_SMALLINT, which can only hold values between approximately -32,000 and +32,000. If you store any value that would overflow this data type field, UCanAccess driver does not report the overflow and saves overflown (incorrect) value.

    Check the value before insertion.

    Introduced in version 4.0.7.

    Advanced Properties of JDBC driver

    Thread-safe connection

    Transaction isolation

    Holdability

    In addition to the Basic properties tab described above, the Database connection dialog also offers the Advanced properties tab.

    db connection advanced tab
    Figure 186. Advanced tab of the Database connection dialog

    If you switch to this tab, you can specify some other properties of the selected connection:

    Thread-safe connection

    By default, it is enabled. In this default setting, each thread gets its own connection to prevent problems when more components converse with DB through the same connection object which is not thread safe.

    Transaction isolation

    Allows to specify certain transaction isolation level. More details can be found here: Interface Connection. Possible values of this attribute are:

    • 0 (TRANSACTION_NONE).

      A constant indicating that transactions are not supported.

    • 1 (TRANSACTION_READ_UNCOMMITTED).

      A constant indicating that dirty reads, non-repeatable reads and phantom reads can occur. This level allows a row changed by one transaction to be read by another transaction before any changes in that row have been committed (a "dirty read"). If any of the changes are rolled back, the second transaction will have retrieved an invalid row.

      This is the default value for DB2, EXASolution, Informix, MySQL, MS SQL Server 2008 or newer, MS SQL Server 2000-2005, PostgreSQL and SQLite specifics.

      This value is also used as default when JDBC specific called Generic is used.

    • 2 (TRANSACTION_READ_COMMITTED).

      A constant indicating that dirty reads are prevented; non-repeatable reads and phantom reads can occur. This level only prohibits a transaction from reading a row with uncommitted changes in it.

      This is the default value for Oracle, Sybase and Vertica specifics.

    • 4 (TRANSACTION_REPEATABLE_READ).

      A constant indicating that dirty reads and non-repeatable reads are prevented; phantom reads can occur. This level prohibits a transaction from reading a row with uncommitted changes in it, and it also prohibits a situation where one transaction reads a row, a second transaction alters the row and the first transaction rereads the row, getting different values the second time (a "non-repeatable read").

    • 8 (TRANSACTION_SERIALIZABLE).

      A constant indicating that dirty reads, non-repeatable reads and phantom reads are prevented. This level includes the prohibitions in TRANSACTION_REPEATABLE_READ and further prohibits a situation where one transaction reads all rows that satisfy a where condition, a second transaction inserts a row that satisfies the where condition and the first transaction rereads for the same condition, retrieving the additional "phantom" row in the second read.

    Holdability

    Allows to specify holdability of ResultSet objects created using the Connection. More details can be found here: Interface ResultSet. Possible options are the following:

    • 1 (HOLD_CURSORS_OVER_COMMIT).

      The constant indicating that ResultSet objects should not be closed when the method Connection.commit is called.

      This is the default value for Informix and MS SQL Server 2008 or newer specifics.

    • 2 (CLOSE_CURSORS_AT_COMMIT).

      The constant indicating that ResultSet objects should be closed when the method Connection.commit is called.

      This is the default value for DB2, MS SQL Server 2000-2005, MySQL, Oracle, PostgreSQL, SQLite, Sybase and Vertica specifics.

      This value is also used as default when JDBC specific called Generic is used.

    JNDI resource

    In the JNDI resource tab, you can create a connection from an existing JNDI resource.

    JNDI is a configuration used to obtain a connection from a JNDI-bound data source. A data source generates database connections from a connection pool which is defined on the level of an application server.

    Basic Properties

    In Basic tab of JNDI resource, you can name the database connection and choose a corresponding database JNDI resource from the tree-view.

    Connection name is a user-defined name of the database connection.

    JDBC specific is described in JDBC driver.

    JNDI name is a name of a JNDI data source. If you choose a particular JNDI data source from the tree-view below, JNDI name is filled in.

    Root context allows you to choose root context of JNDI resource. You can choose one of the pre-filled values: java:comp, java:comp/env and <empty>, or you can add your own value: click the combo, type the value, and press Enter.

    db connection 0360
    Figure 187. JNDI resource - Basic tab

    To create a database connection, specify the Connection name and choose the database JNDI resource from the tree-view. If there are too many resources, Filter might help you.

    If you have configured JNDI resource but you cannot see it in the list, there can be a problem with configuration (e.g. typo or bad password) or the database might refuse the resource to connect due to limit on connections. You can enter the JNDI Name and use the connection to see the cause.

    Advanced Properties

    The advanced tab of JNDI resource has the same configurable items as the advanced tab of JDBC driver. See Advanced Properties of JDBC driver.

    db connection 0370
    Figure 188. JNDI resource - Basic tab