FileMaker ® ODBC and JDBC Guide
© 2004–2019 FileMaker, Inc. All Rights Reserved. FileMaker, Inc. 5201 Patrick Henry Drive Santa Clara, California 95054 FileMaker, FileMaker Cloud, FileMaker Go and the file folder logo are trademarks of FileMaker, Inc. registered in the U.S. and other countries. FileMaker WebDirect is a trademark of FileMaker, Inc. All other trademarks are the property of their respective owners. FileMaker documentation is copyrighted.
Contents Chapter 1 Introduction About this guide Where to find FileMaker documentation About ODBC and JDBC Using FileMaker software as an ODBC client application Importing ODBC data Adding ODBC tables to the relationships graph Using a FileMaker database as a data source Accessing a hosted FileMaker Pro Advanced database Limitations with third-party tools Networking requirements Updating files from previous versions Chapter 2 Accessing external SQL data sources Importing ODBC data Executing SQL to interact
Contents Accessing a FileMaker database file from a Windows application Specifying ODBC client driver properties for a FileMaker DSN (Windows) Verifying access via ODBC (Windows) Accessing a FileMaker database file from a macOS application Specifying ODBC client driver properties for a FileMaker DSN (macOS) Verifying access via ODBC (macOS) Chapter 5 Installing FileMaker JDBC client drivers Software requirements Networking requirements JDBC client access to FileMaker Cloud JDBC client driver installation
Chapter 1 Introduction This guide describes how you can use FileMaker® software as an ODBC client application and as a data source for Open Database Connectivity (ODBC) and Java Database Connectivity (JDBC) applications. The following table gives an overview of how to use ODBC and JDBC with FileMaker software. What do you want to do? How do you do it? 1 Use FileMaker software Product See 1. Interactively via the relationships graph 2.
Chapter 1 | Introduction 6 About ODBC and JDBC ODBC and JDBC are application programming interfaces (APIs). ODBC is an API for applications written in the C language, and JDBC is a similar API for the Java language. These APIs give client applications a common language for interacting with a variety of data sources and database services, including FileMaker Pro Advanced and FileMaker Server. All applications that support ODBC and JDBC recognize a basic subset of SQL (Structured Query Language) statements.
Chapter 1 | Introduction 7 Because FileMaker Pro Advanced generates the SQL statements used to communicate with an ODBC table that has been added to the relationships graph, you are limited to the specific Oracle, SQL Server, and MySQL data sources that FileMaker Pro Advanced supports in the relationships graph. Note You cannot modify the schema of external ODBC data sources using FileMaker Pro Advanced.
Chapter 1 | Introduction 8 Limitations with third-party tools Microsoft Access: When using Microsoft Access to view data in a FileMaker data source, do not use data from a summary field. The summary field’s data should not be edited in Microsoft Access, and the data value that is displayed in Microsoft Access may not be accurate. Networking requirements You need a TCP/IP network when using FileMaker Server to host a FileMaker database file as a data source over a network.
Chapter 2 Accessing external SQL data sources As an ODBC client application, FileMaker software can access data in external SQL data sources. FileMaker software connects to the external SQL data source using the client driver for the ODBC data source, and either imports ODBC data or works with ODBC tables in the relationships graph. Whether you are importing ODBC data or working with ODBC tables in the relationships graph, you must configure a driver for the ODBC data source you’re using.
Chapter 2 | Accessing external SQL data sources 10 6. Using the FileMaker Pro Advanced SQL Query builder dialog box, you can construct a query. Select the table from which you want to import, and then select specific columns you want to use in your SQL query. Use the WHERE tab to construct search criteria and the ORDER BY tab to specify a sort order. You can also type an SQL statement directly into the SQL Query builder dialog box.
Chapter 2 | Accessing external SQL data sources 11 Working with ODBC tables in the relationships graph When you add an ODBC table to the relationships graph, you can connect to and work with data in external SQL data sources in much the same way that you work with data in the current, active FileMaker database file.
Chapter 3 Installing FileMaker ODBC client drivers To access a hosted FileMaker database file as an ODBC data source, you need to install the ODBC client driver. These instructions help you install the ODBC client driver needed to access FileMaker as a data source from third-party and custom applications via ODBC. Install the client driver on the machine where the third-party application is installed.
Chapter 3 | Installing FileMaker ODBC client drivers 13 To install the ODBC client driver: 1. Do one of the following: 1 If you received your software electronically, double-click the installation icon (.exe file). 1 If you have an installation disk, insert the disk into the drive. 2. In the FileMaker Pro Advanced or FileMaker Server window, double-click the Extras folder. 3. Double-click the xDBC folder. 4. In the xDBC folder, double-click the ODBC Client Driver Installer folder. 5.
Chapter 3 | Installing FileMaker ODBC client drivers 14 To open the 32-bit ODBC administrator on a 64-bit Windows operating system: In Windows Control Panel, open Administrative Tools > ODBC Data Sources (32-bit). To open the 64-bit ODBC administrator on a 64-bit Windows operating system: In Windows Control Panel, open Administrative Tools > ODBC Data Sources (64-bit). Configuring the DSN (Windows) To configure the ODBC client driver: 1.
Chapter 3 | Installing FileMaker ODBC client drivers 15 To auto-detect language settings, select the Auto-detect language settings for application option. To specify the language setting, clear the Auto-detect language settings for application option and select the system setting you want to use. For the Multi-byte text encoding option, select System or select UTF-8.
Chapter 3 | Installing FileMaker ODBC client drivers 16 7. When the installation is complete, click Close. The ODBC client driver will be installed in this folder: /Library/ODBC Note You cannot change the installation folder for the ODBC client driver. The ODBC client driver, FileMaker ODBC, is now available for you to configure for accessing a FileMaker data source.
Chapter 3 | Installing FileMaker ODBC client drivers 17 Click Continue. Otherwise, click Finish to save your data source information. 8. For Database, select a database from the list of available databases, or type the filename of the FileMaker database file you’re using as a data source. Note For database files hosted by FileMaker Server, the list of databases may be filtered based on the Filter Databases setting. See FileMaker Server Help.
Chapter 3 | Installing FileMaker ODBC client drivers 18 Where to go from here After you install and configure a client driver, you can construct and execute SQL queries to access a FileMaker data source. Client applications sometimes use different terminology for accessing a data source via ODBC. Many applications have menu items with names such as Get external data or SQL query. Review the documentation or Help that comes with your application for details.
Chapter 4 Using ODBC to share FileMaker data Use the ODBC client driver to connect to a FileMaker data source from another application. The application that uses the ODBC client driver can directly access the data in a FileMaker database file. The FileMaker ODBC client driver is FileMaker ODBC. Note You can also use FileMaker Pro Advanced as an ODBC client application, interacting with records from another data source via ODBC using SQL.
Chapter 4 | Using ODBC to share FileMaker data 20 Using the ODBC client driver The ODBC client driver supports ODBC 3.0 Level 1. You can use the ODBC client driver with any ODBC-compliant application.
Chapter 4 | Using ODBC to share FileMaker data 21 4. Connect to the FileMaker data source. 5. Construct and execute an SQL query in the client application. Each FileMaker database file that is open and set up for access is a separate data source (you create a DSN for each FileMaker database file you want to access as a data source). Each database can have one or more tables. FileMaker fields are represented as columns.
Chapter 4 | Using ODBC to share FileMaker data 22 Accessing a FileMaker database file from a macOS application Specifying ODBC client driver properties for a FileMaker DSN (macOS) Create a DSN for each FileMaker database file you want to access as a data source. The DSN identifies the FileMaker ODBC client driver, the location of the FileMaker host application, and the FileMaker database file you’re accessing as a data source.
Chapter 5 Installing FileMaker JDBC client drivers To access a hosted FileMaker database file as a JDBC data source, you need to install the JDBC client driver. These instructions help you install the client driver needed to access FileMaker as a data source from third-party and custom applications via JDBC. Install the client driver on the machine where the third-party application is installed. Check for updates to the client drivers on the FileMaker downloads and resources page.
Chapter 5 | Installing FileMaker JDBC client drivers 24 4. In the xDBC folder, double-click the JDBC Client Driver Installer folder. 5. Copy the fmjdbc.jar file to the appropriate folder for your operating system: 1 Windows: Copy the fmjdbc.jar file to the folder that includes your Java executable file (java.exe) or to another folder location included in the ClassPath of your Java application. 1 macOS: Copy the fmjdbc.
Chapter 6 Using JDBC to share FileMaker data If you’re a Java programmer, you can use the JDBC client driver with any Rapid Application Development (RAD) tool to visually create a Java application or applet that connects to a FileMaker data source. The Java application or applet that uses the JDBC client driver can directly access the data in a FileMaker database file. About JDBC JDBC is a Java API for executing SQL statements, the standard language for accessing relational databases.
Chapter 6 | Using JDBC to share FileMaker data 1 1 1 1 1 26 updating of columns containing CLOB, ARRAY, and REF data types Boolean data type DATALINK data type transform groups and type mapping relationships between the JDBC SPI and the Connector architecture The JDBC client driver has been tested against the Java Development Kit (JDK) 1.6, 1.7, and 1.8. It is a Type 4 driver—a native protocol, pure Java driver that converts JDBC calls directly into the network protocol used by FileMaker.
Chapter 6 | Using JDBC to share FileMaker data Example import java.sql.*; class FMPJDBCTest { public static void main(String[ ] args) { // register the JDBC client driver try { Driver d = (Driver)Class.forName("com.filemaker.jdbc.Driver").newInstance(); } catch(Exception e) { System.out.println(e); } // establish a connection to FileMaker Connection con; try { con = DriverManager.getConnection(“jdbc:filemaker://192.168.1.1/myda tabase”,”username”, “password”); } catch(Exception e) { System.out.
Chapter 6 | Using JDBC to share FileMaker data 28 Specifying driver properties in the URL subname Specify the user and password driver properties in the subname of the JDBC URL. These are the properties that could be passed to the connection when calling the DriverManager.getConnection method via the Properties parameter.
Chapter 6 | Using JDBC to share FileMaker data 29 Example Connection conn = DriverManager.getConnection ( "jdbc:filemaker://192.168.1.1/customers?SocketTimeout=100", "admin", "admin" ); Solutions with multiple FileMaker database files If your FileMaker database solution uses many FileMaker database files, create an additional database file that contains all the necessary external data source references, table occurrences, and relationships for your solution.
Chapter 7 Reference information ODBC Catalog functions The ODBC client driver supports the following Catalog functions: 1 1 1 1 1 SQLTables—catalog information is stored and reported as single part names (table name only) SQLColumns SQLColumnPrivileges SQLDescribeCol SQLGetTypeInfo JDBC DatabaseMetaData methods The JDBC client driver supports the following DatabaseMetaData methods: 1 1 1 1 getColumns getColumnPrivileges getMetaData 1 getTables 1 getTableTypes 1 getVersionColumns getTypeInfo Mapping
Chapter 7 | Reference information 31 String length is optional in table declarations. All strings are stored and retrieved in Unicode. Note FileMaker repeating fields are supported like arrays. Example INSERT INTO mytable(repField[3]) VALUES (‘this is rep 3’) SELECT repField[1], repField[2] FROM mytable Mapping FileMaker fields to JDBC data types The JDBC client driver uses the following mappings when converting FileMaker data types to JDBC SQL types.
Chapter 7 | Reference information 32 FileMaker ODBC error messages An error that occurs in the FileMaker XDBC Listener or data source includes the DSN, in the following format: [FileMaker] [FileMaker ODBC] message Example [FileMaker] [FileMaker ODBC] Invalid Account/Password If you get this type of error, you did something incorrectly with the database system. Check your FileMaker documentation for more information or consult your database administrator.
Index Numerics 32-bit architecture 12 client driver (Windows) 13 ODBC administrator (Windows) 13 64-bit architecture 12 client driver (Windows) 13 data types 31 ODBC administrator (Windows) 14 A Access via ODBC/JDBC extended privilege 20 accounts and privileges 20 ARRAY data type 26 auto-generated keys 25 disabling a shared FileMaker database file 7 documentation 5 DOUBLE 31 driver properties JDBC client driver 28 ODBC client driver (macOS) 22 ODBC client driver (Windows) 21 drivers, compatible versions 8
I Oracle 11 Import Records script step 9, 10 importing ODBC data 9 installation requirements 12, 23 P J Java Development Kit (JDK) 26 Java version 23 JDBC client driver, described 25 described 25 error messages 32 JDBC client driver driver class and main entry point 26 mapping data types 31 registering with the JDBC driver manager 26 specifying the JDBC URL 26 verifying access 29 JDBC SPI 26 M macOS creating a DSN 16 JDBC client driver requirements 23 verifying ODBC access 22 mapping data types JDB
testing access JDBC client driver 29 ODBC client driver (macOS) 22 ODBC client driver (Windows) 21 TIME 31 TIMESTAMP 31 U URL (Uniform Resource Locator) for the JDBC client driver 26 using ODBC and JDBC with FileMaker 5 V VARCHAR 31 verifying access JDBC client driver 29 ODBC client driver (macOS) 22 ODBC client driver (Windows) 21 W websites, FileMaker support pages 5 Windows creating a DSN 21 JDBC client driver requirements 23 verifying ODBC access 21 X XDBC Listener error messages 31 used with JD