Overview
The Database Connector provides functionality to retrieve data from JDBC-compatible relational databases and register it in the Fess index.
This feature requires the fess-ds-db plugin.
Supported Databases
All JDBC-compatible databases are supported. Main examples:
MySQL / MariaDB
PostgreSQL
Oracle Database
Microsoft SQL Server
SQLite
H2 Database
Prerequisites
JDBC driver is required
Read access to the database is required
Proper query design is important when retrieving large amounts of data
Installing JDBC Drivers
Place the JDBC driver in the lib/ directory:
Restart Fess to load the driver.
Configuration
Configure in the admin console under “Crawler” -> “Data Store” -> “Create New”.
Basic Settings
| Item | Example |
|---|---|
| Name | Products Database |
| Handler Name | DatabaseDataStore |
| Enabled | On |
Parameter Configuration
MySQL/MariaDB example:
PostgreSQL example:
Parameter List
Script Configuration
Map SQL column names to index fields:
Available fields:
<column_name>- SQL query result columns, accessed by their label name in the SELECT clause
SQL Query Design
Efficient Queries
Query performance is important when handling large amounts of data:
Note
SQL is sent to the database as-is. Parameter binding (e.g., named parameters) is not supported.
Incremental Crawling
Methods to retrieve only updated records:
URL Generation
Generate document URLs in the script:
Multi-byte Character Support
When handling data with multi-byte characters such as Japanese:
MySQL
PostgreSQL
PostgreSQL uses UTF-8 by default. If needed:
Security
Protecting Database Credentials
Warning
Writing passwords directly in configuration files poses a security risk.
Recommended methods:
Use environment variables
Use Fess encryption features
Use read-only users
Principle of Least Privilege
Grant only minimum necessary permissions to database users:
Usage Examples
Product Catalog Search
Parameters:
Script:
Knowledge Base Articles
Parameters:
Script:
Troubleshooting
JDBC Driver Not Found
Symptom: ClassNotFoundException or No suitable driver
Resolution:
Verify that JDBC driver is placed in
lib/Verify driver class name is correct
Restart Fess
Connection Errors
Symptom: Connection refused or authentication errors
Check:
Is the database running?
Is the hostname and port correct?
Is the username and password correct?
Firewall settings
Query Errors
Symptom: SQLException or SQL syntax errors
Check:
Test the SQL query directly on the database
Verify column names are correct
Verify table names are correct
Reference Information
Data Store Connector Overview - Data Store Connector Overview
CSV Connector - CSV Connector
JSON Connector - JSON Connector
Data Store Crawling - Data Store Configuration Guide