FileMaker 14 ® ODBC and JDBC Guide
© 2004–2015 FileMaker, Inc. All Rights Reserved. FileMaker, Inc. 5201 Patrick Henry Drive Santa Clara, California 95054 FileMaker and FileMaker Go are trademarks of FileMaker, Inc. registered in the U.S. and other countries. The file folder logo and FileMaker WebDirect are trademarks 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 database Limitations with third-party tools Networking requirements Updating files from previous versions Installing current drivers Chapter 2 Accessing external SQL data sources Importing ODBC data Executi
Specifying ODBC client driver properties for a FileMaker DSN (OS X) Verifying access via ODBC (OS X) Chapter 5 Installing FileMaker JDBC client drivers Software requirements Networking requirements JDBC client driver installation Using the JDBC client driver Chapter 6 Using JDBC to share FileMaker data About JDBC Using the JDBC client driver About the JDBC client driver Using a JDBC URL to connect to your database Specifying driver properties in the URL subname Solutions with multiple FileMaker databas
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? Product See 1 Use FileMaker software as an 1. Interactively via the relationships graph 2. One-time, static via ODBC import or File menu > Open.
Chapter 1 | Introduction 6 All applications that support ODBC and JDBC recognize a basic subset of SQL (Structured Query Language) statements. Working with SQL, you can use other applications (such as spreadsheets, word processors, and reporting tools) to view, analyze, and modify data. Using ODBC or JDBC APIs, a client application communicates with a driver manager that identifies the client driver to communicate with a data source.
Chapter 1 | Introduction 7 Using a FileMaker database as a data source As a data source, FileMaker data is shared with ODBC- and JDBC-compliant applications. The application connects to the FileMaker data source using the FileMaker client driver, constructs and executes the SQL queries using ODBC or JDBC, and processes the data retrieved from the FileMaker database solution.
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 5. Choose your data source, enter the user name and password (if any), and click OK to open the FileMaker Pro SQL Query builder dialog box. 6. Using the FileMaker Pro 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.
Chapter 2 | Accessing external SQL data sources 11 When you use FileMaker Pro or FileMaker Server as the host for a solution that includes ODBC tables in the relationships graph, you configure the ODBC client driver for the external SQL data source on the host machine.
Chapter 3 Installing FileMaker ODBC client drivers 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. The ODBC client driver is available through a separate installation on your FileMaker installation disk or electronic download in the xDBC folder. Check for updates to the client drivers at this URL: http://www.filemaker.
Chapter 3 | Installing FileMaker ODBC client drivers 13 4. In the ODBC Client Driver Installer folder, double-click the installer file for the driver you want to install. 1 To install the 32-bit client driver (fmodbc32.dll), use the 32-bit installer file: FMODBC_Installer_Win32.msi 1 To install the 64-bit client driver (fmodbc64.dll), use the 64-bit installer file: FMODBC_Installer_Win64.msi The FileMaker ODBC Driver Setup Wizard opens. 5.
Chapter 3 | Installing FileMaker ODBC client drivers 14 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). Note Administrative Tools control panel appears in the System and Security category. The 64-bit ODBC Data Source Administrator opens. Configuring the DSN (Windows) To configure the ODBC client driver: 1. In the ODBC Data Source Administrator, select the System DSN or User DSN tab.
Chapter 3 | Installing FileMaker ODBC client drivers 15 For the Multi-byte text encoding option, select System or select UTF-8. For example, some applications such as Microsoft Excel may expect text to be encoded using the System encoding, but web applications may expect text to be encoded using UTF-8 encoding. If the application expects a specific encoding but this option specifies a different encoding, then the application may display some characters incorrectly.
Chapter 3 | Installing FileMaker ODBC client drivers 16 6. 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 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 File Display Filter setting. See FileMaker Server Help for information. 1 If you need special handling of non-English text, click Advanced Language.
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 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 You can use the ODBC client driver with any ODBC-compliant application. Sharing your FileMaker database file as a data source, you can: 1 1 1 1 perform mail merges with Microsoft Word. create charts with Microsoft Excel. move FileMaker data to a DBMS like Microsoft SQL Server. further analyze your FileMaker data with query or reporting tools to create charts, construct adhoc queries, and perform drill-down analysis.
Chapter 4 | Using ODBC to share FileMaker data 21 3. Make sure the FileMaker database file you want to access is hosted and available. If your FileMaker database solution uses more than one FileMaker database file, all of the database files must be on the same computer. 4. Connect to the FileMaker data source. 5. Construct and execute an SQL query in the client application.
Chapter 4 | Using ODBC to share FileMaker data 22 1 Make sure your FileMaker account uses a privilege set with the extended privilege of Access via ODBC/JDBC. 1 Verify that the FileMaker Server or FileMaker Pro host application has been set up for sharing via ODBC/JDBC. Accessing a FileMaker database file from an OS X application Specifying ODBC client driver properties for a FileMaker DSN (OS X) Create a DSN for each FileMaker database file you want to access as a data source.
Chapter 5 Installing FileMaker JDBC client drivers These instructions help you install the client driver needed to access FileMaker as a data source from third-party and custom applications via JDBC. The client driver is available on your FileMaker DVD or electronic download in the xDBC folder. Check for updates to the client drivers at this URL: http://www.filemaker.
Chapter 5 | Installing FileMaker JDBC client drivers 24 Using the JDBC client driver Your Java application or applet must register the JDBC client driver with the JDBC driver manager, and you must specify the correct JDBC URL from within the application or applet. Important You must reserve the port 2399 for the FileMaker JDBC client driver. The port number is always 2399. You cannot change the JDBC sharing to a different port.
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 Relationship between the JDBC SPI and the Connector architecture The JDBC client driver has been tested against the Java Development Kit (JDK) 1.6 and 1.7. 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 27 3. Returns error codes. 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.
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 Verifying access via JDBC When verifying access to a FileMaker database file via JDBC, make sure: 1 the FileMaker database file is hosted and available. 1 your FileMaker account uses a privilege set with the extended privilege of Access via ODBC/JDBC. 1 The FileMaker Server or FileMaker Pro host application has been set up for sharing via ODBC/JDBC.
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).
Chapter 7 | Reference information 31 FileMaker field type Converts to ODBC data type About the data type container (BLOB) SQL_LONGVARBINARY You can retrieve binary data, file reference information, or data of a specific file type from a container field. Within a SELECT statement, use the CAST() function to retrieve file reference information, and use the GetAs() function to retrieve data of a specific file type. calculation The result is mapped to the corresponding ODBC data type.
Chapter 7 | Reference information 32 ODBC and JDBC error messages Here are the basic formats of error messages you receive when working with FileMaker and ODBC/JDBC.
Index Numerics 32-bit architecture 12 client driver (OS X) 15 client driver (Windows) 13 ODBC administrator (OS X) 16 ODBC administrator (Windows) 13 64-bit architecture 12 client driver (OS X) 15 client driver (Windows) 13 data types 31 ODBC administrator (OS X) 16 ODBC administrator (Windows) 14 A Access via ODBC/JDBC extended privilege 20 accounts and privileges 20 ARRAY data type 26 auto-generated keys 25 B BLOB 31 Boolean data type 26 C data type mapping JDBC client driver 31 ODBC client driver 30
H holdable cursors in JDBC 25 I Import Records script step 9, 10 importing ODBC data 9 installation requirements 12, 23 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 mapping data types JDBC client driver 31 ODBC client driver 30 metadata methods 30 Microso
T TCP/IP requirements 8 testing access JDBC client driver 29 ODBC client driver (OS X) 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 (OS X) 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 me