Home →
Using LincDoc 3.1+ →
Database Lookups →
Connecting LincDoc to an External Database
19.2. Connecting LincDoc to an External Database
You can configure a connection between LincDoc and an external database using the Databases dialog box.
Once a connection has been established, you use database lookups in a lookup action to pull database information into your forms. This connection may also be used for the stored procedure action.
Proceed to one of the following sections for more information:
Accessing the Databases Dialog Box
On the LincDoc toolbar, click the system button, and select databases from the list of options that appears.
The Databases dialog box appears, displaying any currently configured database connections.
About the "default" Connection
A default database connection is supplied with every installation of LincDoc.
You cannot delete this connection; it is the connection to the back-end database that drives the LincDoc application. In addition, certain configuration settings (such as Max idle, Max wait, and the property/value pairings) are only available to superusers (the "admin" account).
In addition, this database is the default database used for the LincDoc repository.
Adding a New Database
You can add a new database connection using the new database button on the Databases dialog box.
- Access the Databases dialog box.
- At the top of the Databases dialog box, click the new database button.
The New Database dialog box appears.
- In the ID text box, type a name for the new database connection.
This name will appear in the list of existing database connections on the Databases dialog box.
- Click OK.
The Configure database dialog box appears.
- Proceed to Configuring a Database Connection below.
You can configure an existing database connection using the Configure database dialog box, which is accessed via the configure button on the Databases dialog box.
- Access the Configure databases dialog box using one of the following options:
- If you are creating a new database connection, the dialog box automatically appears when creating a new database as described in Adding a New Database.
- If you are editing an existing database connection, click the edit icon that corresponds to the appropriate connection.
- On the Configure database dialog box, specify or alter the connection options, as necessary.
Note: For assistance on determining your exact local settings, contact your local database administrator.
The following options are available:
- Driver. Specify the driver that will be used for the connection, based on the type of database the connection will use.
The following options are available:
- MySQL (MariaDB)
- Microsoft SQL Server
- Oracle
- PostgreSQL
- Sybase
- URL. Specify the hostname of the database system, the port number to connect to on that system, and the particular database instance on that system. The specific syntax is dependent on the driver chosen. When a new driver is chosen, this field is populated with a template appropriate to the driver.
For example, a URL for connecting to a Microsoft SQL Server database would appear similar to the following:
jdbc:jtds:sqlserver://72.1.207.241:1433/lincdoc_database
Or consider this more advanced example which overrides the default database instance:
jdbc:jtds:sqlserver://10.10.10.1:1433;database=HR;instance=SQL2012
Tip: In most situations you should enable "mixed" mode authentication on your SQL Server database.
- Username. The name of the user that has access to the database.
- Password. The specified user's database password.
- Max active. Set the maximum number of connections LincDoc should attempt to use to the database.
Tip: Whenever possible, you should use the default value.
- Max idle. Set the maximum number of idle connections LincDoc should maintain to the database. These idle connections allow LincDoc to maintain a minimal connection to the database, so that when an actual connection is needed, the communication between LincDoc and the database will be faster, the necessary data will be transferred more rapidly, as it does not require the overhead of creating a new connection.
Tip: It is recommended that you use the default value.
- Max wait (ms). Set the most amount of time LincDoc should wait for a connection to become available, if all connections are already in use.
Tip: It is recommended that you use the default value.
- Validation query. Specify a sample SQL query that will be run when LincDoc is trying to determine if a connection is still valid (sometimes connections timeout, and thus become unresponsive).
Tip: It is recommended that you use the default value.
- If necessary, specify custom properties and values using the table at the bottom of the dialog box.
Important: These property and value settings are designed for advanced users, and allow you to pass extra parameters to the JDBC driver. The parameters that can be passed are dependent on the selected JDBC driver. For example, review the following website for more information on parameters used by Microsoft SQL Server.
- Click the add button (highlighted below).
The property name dialog box appears.
- In the New property name text box, type a name for the property.
- Click OK.
The new property appears in the property column of the table on the Configure database dialog box.
- Specify a value for the property in the value column.
- At the top of the Configure database dialog box, click test.
Your configuration settings are tested, and if the database connection works as expected, a Success dialog box appears. Otherwise, verify that your settings are correct and re-test.
- Click OK to close the Success dialog box.
- At the top of the Configure database dialog box, click save.
You are returned to the Databases dialog box.
Applying Configuration Updates
You must click the apply button at the top of the Databases dialog box to verify that the configuration updates are being used.
A message appears, confirming that you most recent changes have been applied to the database configurations.
Click OK to close the dialog box.
Uploading a CSV File
You can upload an external CSV file to create a new database table, or replace an existing table.
- Access the Configure databases as described in Configuring a Database Connection.
- Click the upload button that corresponds to the appropriate connection.
The Upload CSV to database dialog box appears.
- From the Table drop-down list, select the existing database table that will hold the data from the CSV file. This will replace the entire contents of the table. If you wish to create a new table, type in the name instead of picking from the list.
- Click the select button.
The Open dialog box appears.
- Navigate to the location of the CSV file you want to use, and click it to select it.
- Click Open.
You are returned to the Upload CSV to database dialog box, and the selected CSV file now appears next to the select button.
- Click upload.The data in the CSV file is loaded to the specified database table.
Exporting a Database Table
You can use the export button on the Databases dialog box to export data from a connected database's table to a local CSV file.
Exporting the table data requires that you select the appropriate database, schema, and table from a displayed list.
- Click the export button that corresponds to the database whose data you want to export.
A list of the database's schema appears.
- Click the desired schema.
A list of the schema's tables appears.
- Click the table whose data you want to export.
The table's data is saved into a CSV file and downloaded by your browser.
Note: The exact process for downloading the CSV file differs based on your current web browser.
Removing a Database Configuration
For more information, see Deleting a Database Connection.