Database Connections
Using direct database connections for data integration with FileMaker
Direct database connections provide a powerful way to integrate FileMaker with other database systems without intermediary files or web services.
Database Connection Overview
Database connections allow FileMaker to directly read from and write to external database systems, enabling:
- Real-time data access
- Bi-directional data flow
- Complex query capabilities
- Transaction support
Connection Types
ODBC (Open Database Connectivity)
ODBC is a standard API for accessing database management systems:
- Widespread support: Works with most database systems
- Cross-platform: Available on Windows, macOS, and Linux
- FileMaker as client: Connect to external databases from FileMaker
- FileMaker as server: Allow other applications to connect to FileMaker
JDBC (Java Database Connectivity)
Java-specific API for database connections:
- Java integration: Ideal for Java applications
- FileMaker JDBC driver: Available for connecting Java apps to FileMaker
- Not used in FileMaker: FileMaker uses ODBC, not JDBC, to connect to other databases
Native Drivers
Some systems offer direct, native drivers for specific databases:
- Performance: Often faster than ODBC
- Features: May support database-specific features
- FileMaker: FileMaker has it's own native protocol to connect from client to server.
FileMaker as a Data Source
FileMaker can act as a data source for other applications:
FileMaker ODBC Driver
Allows external applications to connect directly to FileMaker:
- Install the FileMaker ODBC driver on the client computer
- Configure the ODBC DSN
- Enable ODBC/JDBC in FileMaker Server
- Set up proper privileges in the FileMaker file
FileMaker JDBC Driver
Similar to ODBC but specifically for Java applications:
FileMaker Accessing External Data
FileMaker can connect to external databases in two primary ways:
External SQL Sources (ESS)
ESS allows FileMaker to integrate with external SQL databases directly:
- Setup: In FileMaker, go to File > Manage > External Data Sources
- Add Source: Add an ODBC data source
- Usage: Once connected, external tables appear as if they were local tables
Benefits of ESS:
- Native FileMaker interface to external data
- Ability to create relationships between FileMaker and external tables
- Support for find operations and scripting
Supported databases include:
- MySQL
- MariaDB
- SQL Server
- Oracle
- PostgreSQL
Execute SQL Script Step
For more advanced operations, the Execute SQL script step provides direct SQL access:
This approach allows:
- Complex queries beyond what ESS supports
- Transaction control
- Stored procedure execution
- Bulk operations
Implementation Patterns
Shadow Tables
Create mirror tables in FileMaker that synchronize with external databases:
- Create tables in FileMaker matching external structure
- Set up scheduled scripts to sync data
- Configure conflict resolution rules
Live Connections
Work directly with external data in real-time:
- Connect via ESS
- Create relationships between FileMaker and external tables
- Build interfaces that read/write directly to external data
Hybrid Approach
Combine local and external data tactically:
- Import frequently used reference data into FileMaker
- Keep large transaction tables in external databases
- Sync on a schedule or on-demand
Performance Considerations
When using database connections:
- Connection pooling: Reuse connections when possible
- Indexing: Ensure proper indexes on both systems
- Query optimization: Write efficient SQL queries
- Transaction size: Batch operations for better performance
- Network latency: Consider the impact of network speed on integration
Security Best Practices
- Least privilege: Use accounts with minimal required permissions
- Credential management: Securely store and manage database credentials
- Connection encryption: Use SSL/TLS when possible
- Audit trails: Log database activities for security monitoring
- Network security: Restrict database servers to specific IP addresses