Filemaker ODBC And JDBC Guide File Maker Pro 13 Fm13 En

User Manual: filemaker FileMaker Pro 13 - ODBC and JDBC Guide Free User Guide for FileMaker Software, Manual

Open the PDF directly: View PDF PDF.
Page Count: 37

DownloadFilemaker ODBC And JDBC Guide File Maker Pro 13 - Fm13 En
Open PDF In BrowserView PDF
FileMaker 13
®

ODBC and JDBC Guide

© 2004–2013 FileMaker, Inc. All Rights Reserved.
FileMaker, Inc.
5201 Patrick Henry Drive
Santa Clara, California 95054
FileMaker and Bento are trademarks of FileMaker, Inc. registered in the U.S. and other countries. The file folder logo,
FileMaker WebDirect, and the Bento logo are trademarks of FileMaker, Inc. All other trademarks are the property of their
respective owners.
FileMaker documentation is copyrighted. You are not authorized to make additional copies or distribute this documentation
without written permission from FileMaker. You may use this documentation solely with a valid licensed copy of FileMaker
software.
All persons, companies, email addresses, and URLs listed in the examples are purely fictitious and any resemblance to
existing persons, companies, email addresses, or URLs is purely coincidental. Credits are listed in the Acknowledgements
documents provided with this software. Mention of third-party products and URLs is for informational purposes only and
constitutes neither an endorsement nor a recommendation. FileMaker, Inc. assumes no responsibility with regard to the
performance of these products.
For more information, visit our website at http://www.filemaker.com.
Edition: 01

Contents
Chapter 1
Introduction
About this guide
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
Executing SQL to interact with data sources via ODBC
Working with ODBC tables in the relationships graph
Data sources supported in FileMaker 13
Adding ODBC tables to the relationships graph

Chapter 3
Installing FileMaker ODBC client drivers
Hardware and software requirements
ODBC client driver requirements (Windows)
ODBC client driver requirements (OS X)
Networking requirements
ODBC client driver architecture overview
ODBC client driver installation (Windows)
Configuring client drivers (Windows)
Opening the ODBC administrator (Windows)
Configuring the DSN (Windows)
ODBC client driver installation (OS X)
Configuring client drivers (OS X)
Where to go from here

5
5
5
6
6
6
7
7
8
8
8
8

9
9
10
10
11
11

12
12
12
12
12
12
13
13
14
14
16
16
18

4

Chapter 4
Using ODBC to share FileMaker data
About ODBC
Using the ODBC client driver
Overview of accessing a FileMaker database file
Accessing a FileMaker database file from a Windows application
Specifying ODBC client driver properties for a FileMaker DSN (Windows)
Changing an existing ODBC client driver (Windows)
Verifying access via ODBC (Windows)
Accessing a FileMaker database file from an OS X application
Specifying ODBC client driver properties for a FileMaker DSN (OS X)
Changing an existing ODBC client driver (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 database files
Verifying access via JDBC

Chapter 7
Reference Information
ODBC Catalog functions
JDBC Meta Data functions
Mapping FileMaker fields to ODBC data types
Mapping FileMaker fields to JDBC data types
Data types in 64-bit applications
ODBC and JDBC error messages
ODBC error messages
JDBC error messages

Index

19
19
20
20
21
21
21
23
23
23
23
25

26
26
26
26
27

28
28
28
28
29
31
31
32

33
33
33
33
34
34
35
35
35
36

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. Also, the
Import Records script step, the
Execute SQL script step, and the
ExecuteSQL function

1 FileMaker Pro
1 FileMaker Pro Advanced
1 FileMaker Server

1 This guide,

1. ODBC and JDBC
2. SQL queries

1 FileMaker Pro
1 FileMaker Pro Advanced
1 FileMaker Server

1 This guide,

ODBC client application.

1 Access ODBC data stored in an
external SQL data source.

1 Use a FileMaker database as a
data source.

1 Share FileMaker Pro data with a
third-party ODBC client
application.

chapter 2.

1 FileMaker Pro
Help

chapters 3 to 6.

1 FileMaker SQL
Reference

About this guide
1 For information on using ODBC and JDBC with previous versions of FileMaker Pro, see
http://www.filemaker.com/documentation.

1 This guide assumes that you are familiar with the basics of using ODBC and JDBC, and

constructing SQL queries. Refer to a third-party book for more information on these topics.

1 This guide uses “FileMaker Pro” to refer to both FileMaker Pro and FileMaker Pro Advanced,
unless describing specific FileMaker Pro Advanced features.

Note You can download PDFs of FileMaker documentation from
http://www.filemaker.com/documentation. Any updates to this document are also available from
the website.

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 and FileMaker Server.
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.

Chapter 1 | Introduction

6

Using ODBC or JDBC APIs, a client application communicates with a driver manager that
identifies the client driver to communicate with a data source.
Client
Application

Driver
Manager

Client
Driver

Data Source

FileMaker software can act either as a client application or as a data source.

Using FileMaker software as an ODBC client application
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.

Importing ODBC data
You can import ODBC data in either of these ways:

1 from the File menu, by specifying an ODBC data source and entering SQL statements in the
FileMaker Pro SQL Query builder dialog box

1 by creating a FileMaker script that uses the Import Records script step, the Execute SQL script
step, or the ExecuteSQL function

For either of these methods, you enter the SQL statements yourself, so you need to know the
supported SQL statements and their syntax for your ODBC data source. And because you write the
SQL statements, you can import ODBC data from any ODBC data source. For more information on
SQL statements and syntax supported by FileMaker, see FileMaker SQL Reference.

Adding ODBC tables to 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. For example, you can:

1 create tables in the relationships graph for ODBC data sources
1 add supplemental fields to ODBC tables to perform unstored calculations or to summarize data
in the ODBC tables

1 add, change, and delete external data interactively
1 create relationships between fields in FileMaker tables and fields (also called “columns”) in
ODBC tables

Because FileMaker Pro 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 supports in the relationships graph.
Note You cannot modify the schema of external ODBC data sources using FileMaker Pro.
Chapter 2, “Accessing external SQL data sources,” describes how to use FileMaker software as
an ODBC client application.

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.

Accessing a hosted FileMaker Pro database
With either FileMaker Server or FileMaker Pro, you can host a FileMaker database file as a data
source, sharing your data with other applications using ODBC and JDBC. The following table
describes what each FileMaker product allows.
This FileMaker product

Allows

FileMaker Server

Unlimited connections and supports local access (same computer) and remote access
(both for middleware such as web servers, and for remote client access from desktop
productivity applications).

FileMaker Pro

Up to nine connections and supports local access (same computer) only.

If your FileMaker database solution uses more than one FileMaker database file, all of the
database files must be on the same computer.
To access a hosted FileMaker database file, you need to install the corresponding ODBC or JDBC
client driver. Install the client driver on the machine where the third-party application is installed.
This guide documents how the ODBC and JDBC client drivers, when used with FileMaker Pro and
FileMaker Server, support the industry standards for ODBC and JDBC.

1 Chapter 3, “Installing FileMaker ODBC client drivers,” explains how to install the driver files
needed for accessing a FileMaker data source using ODBC.

1 Chapter 4, “Using ODBC to share FileMaker data,” describes how to use the FileMaker ODBC
client driver to connect to a FileMaker data source from another application.

1 Chapter 5, “Installing FileMaker JDBC client drivers,” explains how to install the driver files
needed for accessing a FileMaker data source using JDBC.

1 Chapter 6, “Using JDBC to share FileMaker data,” describes how to use the FileMaker JDBC
client driver with a Java application or applet that connects to a FileMaker data source.

1 Chapter 7, “Reference Information,” describes mapping FileMaker fields to ODBC and JDBC
data types.

To learn about the SQL statements supported by ODBC and JDBC client drivers when used with
FileMaker Pro and FileMaker Server, see FileMaker SQL Reference.
Important If you disable ODBC/JDBC sharing after it has already been on, a data source hosted
by FileMaker Server or FileMaker Pro immediately becomes unavailable. The database
administrator doesn’t have the capability to alert ODBC and JDBC client applications about the
data source’s availability (the administrator can communicate only with FileMaker database file
clients). No errors are reported, and the client application should notify users that the data source
is not available and transactions cannot be completed. If a client application attempts to connect
to an unavailable FileMaker database file, a message explains that the connection failed.

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. FileMaker Pro supports local access (same computer) only.

Updating files from previous versions
Installing current drivers
If you installed a driver from prior versions of FileMaker Pro or FileMaker Server, you must install
the driver for version 13.
The driver for FileMaker version 13 is not compatible with earlier versions of FileMaker Pro or
FileMaker Server.
For more information on installing drivers, see chapter 3, “Installing FileMaker ODBC
client drivers” and chapter 5, “Installing FileMaker JDBC client drivers.”
Note You have to create a Data Source Name (DSN) for each FileMaker database file you want
to access as a data source. If you have previously set up access through one DSN that allows
tables to be spread among several FileMaker database files, you’ll need to consolidate those
tables into a single database file (or create several DSNs).

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. For example, to access
records from an Oracle database, you configure an Oracle client driver.

Importing ODBC data
When you import ODBC data, you need an ODBC client driver for the external SQL data source
configured on the client machine.

FileMaker
Pro

Driver
Manager

Client
Driver

SQL Data
Source

After configuring an ODBC client driver, you can interact with records, import records into an
existing FileMaker Pro database file, or create a new FileMaker Pro database file from an ODBC
data source (such as Oracle or Microsoft Access databases).
First, you access the data source you want to import from. Then you construct a query for the
records you want to import from the data source. Finally, if you’re importing data into an existing
file, you map fields from your data source to fields in your FileMaker Pro database file.
You can access your ODBC data source through the File menu, with the Import Records script
step, with the Execute SQL script step, or with the ExecuteSQL function.
To import ODBC data, follow this general process:
1. Install and configure specific ODBC drivers for the external data sources you want to access.
2. On the computer that hosts the current FileMaker Pro file, define a system Data Source Name
(DSN) for each ODBC data source you want to access.
3. Determine any additional considerations for the ODBC data sources you want to access (for
example, whether users are prompted for a user name and password).
4. In FileMaker Pro, do one of the following:

1 To import into an existing FileMaker Pro file, choose File menu > Import Records > ODBC
Data Source.

1 To create a FileMaker Pro file from the data source records, choose File menu > Open. In
the Open dialog box, choose ODBC Data Source for Files of type (Windows) or Show
(OS X).

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.
You can also type an SQL statement directly into the SQL Query builder dialog box.
You can execute the query immediately, or you can use the Import Records script step, the
Execute SQL script step, or the ExecuteSQL function to execute a query as part of a FileMaker
script.
Note ODBC import, the Execute SQL script step, and external SQL data sources are not
supported in runtime solutions created with FileMaker Pro Advanced.
See FileMaker Pro Help for more information on importing data, using the SQL Query builder
dialog box, and creating FileMaker scripts.

Executing SQL to interact with data sources via ODBC
In addition to importing data into a FileMaker Pro database file via ODBC, you can also interact
with data sources using SQL statements through the Execute SQL script step and the
ExecuteSQL function. The Execute SQL script step may use any SQL statement supported by the
data source, such as INSERT, UPDATE, and DELETE. The ExecuteSQL function supports only
the SELECT statement.
You can also use SQL statements that go beyond simply importing data into a FileMaker Pro
database file. For example, you could execute SQL statements that add records to a database
table in SQL Server, using information from a FileMaker Pro database file.
See FileMaker Pro Help for more information on creating FileMaker scripts that use the Execute
SQL script step and the ExecuteSQL function.

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 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.

FileMaker
Pro user

FileMaker
Pro user

FileMaker Pro
or
FileMaker
Server host
machine

Driver
Manager

Client
Driver

SQL Data
Source

FileMaker
Pro user

Data sources supported in FileMaker 13
As an ODBC client application, FileMaker supports the following external SQL data sources as
ODBC tables in the relationships graph:

1
1
1
1

Oracle 11g
SQL Server 2008 R2
SQL Server 2012
MySQL 5.5

Adding ODBC tables to the relationships graph
To set up a FileMaker Pro database to access data in supported ODBC data sources:
1. Install and configure specific ODBC drivers for the external data sources you want to access.
2. On the computer that hosts the current FileMaker Pro file, define a system Data Source Name
(DSN) for each ODBC data source you want to access.
3. Determine any additional considerations for ODBC data sources you want to access (for
example, whether users are prompted for a user name and password).
4. Add one or more tables from the ODBC data source to the relationships graph in the current
FileMaker Pro file.
5. Add fields to layouts in the FileMaker Pro file to display external data.
6. Optionally, add supplemental fields to external tables and layouts to display calculation and
summary results based on data stored in external ODBC data sources.
See FileMaker Pro Help for detailed steps and additional information on configuring an ODBC
client driver, connecting to ODBC data sources, editing ODBC data sources, and setting up an
ODBC table in the relationships graph.

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.com/support/downloads
If you’ll be hosting a FileMaker database file using FileMaker Server, make the client drivers
available to remote users.
After installing the client driver you need, you can configure the driver to access a FileMaker data
source and construct SQL queries to interact with the data.

Hardware and software requirements
To install and use the ODBC client drivers, you need the following minimum equipment and software:

ODBC client driver requirements (Windows)
1 1 GB RAM minimum for Windows 7 SP1, Windows 8, Windows Server 2008 R2 SP1, and
Windows Server 2012

1 Microsoft Data Access Components (MDAC) 2.8 SP1. The MDAC component is usually
installed with Windows on the supported Windows platforms.

ODBC client driver requirements (OS X)
1 OS X computer with an Intel processor
1 1 GB RAM minimum; 2 GB RAM recommended
1 OS X version 10.7.x, and OS X version 10.8.2 (the software may also work with later versions
certified by FileMaker)

Networking requirements
If you’ll be accessing a FileMaker data source hosted on another computer, you’ll need network
access via TCP/IP.

ODBC client driver architecture overview
FileMaker provides 32- and 64-bit client drivers for both Windows and OS X, to support 32- and
64-bit ODBC applications.
You must install the client driver that matches your ODBC application. If your ODBC application is
a 32-bit application, then install the 32-bit client driver. If your ODBC application is a 64-bit
application, then install the 64-bit client driver.

Chapter 3 | Installing FileMaker ODBC client drivers

13

ODBC client driver installation (Windows)
Windows 32-bit and 64-bit client drivers are installed as separate libraries. On a 32-bit Windows
operating system, you can install the 32-bit client driver only. On a 64-bit Windows operating
system, both the 32-bit and 64-bit client drivers can be installed.
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 or FileMaker Server window, double-click the xDBC folder.
3. In the xDBC folder, double-click the ODBC Client Driver Installer folder.
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. Install the ODBC client driver by following the onscreen instructions.
6. When the installation is complete, click Close.
By default, the ODBC client driver will be installed in this folder:

1 On a 32-bit Windows operating system, the 32-bit client driver (fmodbc32.dll) is installed in
c:\windows\system32

1 On a 64-bit Windows operating system, the 32-bit client driver (fmodbc32.dll) is installed in
c:\windows\SysWOW64

1 On a 64-bit Windows operating system, the 64-bit client driver (fmodbc64.dll) is installed in
c:\windows\system32

The ODBC client driver, FileMaker ODBC, is now available for you to configure for accessing
a FileMaker data source.

Configuring client drivers (Windows)
Before using an ODBC client application to access a FileMaker data source, you must configure
a client driver for the data source. Configuration settings identify the client driver you’re using, the
location of the data source, and details on how you intend to connect.
Important When using a FileMaker client driver, you must reserve 2399 as the port.

Chapter 3 | Installing FileMaker ODBC client drivers

14

Opening the ODBC administrator (Windows)
To configure the 32-bit client driver, you must use the 32-bit ODBC administrator. To configure the
64-bit client driver, you must use the 64-bit ODBC administrator.
To open the 32-bit ODBC administrator on a 32-bit Windows operating system:
In the Windows Control Panel, open Administrative Tools > Data Sources (ODBC).
Note Administrative Tools appear in the System and Security category.
The 32-bit ODBC Data Source Administrator opens.
To open the 32-bit ODBC client driver on a 64-bit Windows operating system:
1. Open the SysWOW64 folder on your system. (By default, the SysWOW64 folder is at
c:\windows\SysWOW64.)
2. Double-click the odbcad32.exe file.
The 32-bit ODBC Data Source Administrator opens.
To open the 64-bit ODBC client driver on a 64-bit Windows operating system:
In the Windows Control Panel, open Administrative Tools > Data Sources (ODBC).
Note Administrative Tools appear in the System and Security category.
The 64-bit ODBC Data Source Administrator opens.

Configuring the DSN (Windows)
To create a DSN for a database hosted by FileMaker Pro, use the 32-bit ODBC administrator. To
create a DSN for a database hosted by FileMaker Server, use the 64-bit ODBC administrator.
For a database hosted by FileMaker Pro that uses the Execute SQL script step, create a 32-bit
User DSN or a 32-bit System DSN. If you host the same database on FileMaker Server, create a
64-bit System DSN with the same name.
To configure the ODBC client driver:
1. In the ODBC Data Source Administrator, select the System DSN or User DSN tab.
2. Click Add.
The Create New Data Source dialog box opens.
3. Select FileMaker ODBC, and click Finish.
The FileMaker DSN Configuration dialog box opens.
4. Click Next.
5. For Name, enter a name that will be meaningful to others accessing the FileMaker data source.
For Description, enter an optional description of the FileMaker data source. Click Next.

Chapter 3 | Installing FileMaker ODBC client drivers

15

6. For Host:

1 If you’re connecting to a database file hosted by FileMaker Pro on your local machine, enter
localhost or the IP address 127.0.0.1.

1 If you’re connecting to a database file hosted by FileMaker Server over a network, enter the
IP address of the FileMaker Server.

If you have enabled sharing via ODBC/JDBC in the host application, you can select Connect
to host to obtain the names of available databases. Click Next.
Otherwise, click Finish to save your data source information.
7. 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.
If you need special handling of non-English text, click Advanced Language. The Advanced
Language Options dialog box opens.

1 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.

1 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.

Select the Describe text fields as long varchar option to correct issues with long field values,
such as fields that do not have a maximum length specified getting used for Microsoft Word Mail
Merge import, or field values in PHP applications that are longer than 255 characters. If you do
not use this option for field values longer than 255 characters, then your application may
retrieve an empty string (Windows) or only 255 characters (OS X).
If you want to create a log file for long-running queries, select the Save long-running queries
to a log file option, and enter the name for the log file.
Click Finish to save your data source information.
8. Review the information about your FileMaker DSN.

1 Click Test to verify that you have correctly configured the ODBC client driver to access the
FileMaker data source. If you receive an error message, you can correct the connection
information. You may also need to check that the FileMaker database file is hosted and
available, that the FileMaker account specified uses a privilege set with the extended
privilege Access via ODBC/JDBC, and that the FileMaker Server or FileMaker Pro host
application has been set up for sharing via ODBC/JDBC.

1 Click Done to save your data source information.

Chapter 3 | Installing FileMaker ODBC client drivers

16

ODBC client driver installation (OS X)
OS X 32-bit and 64-bit client drivers are installed as a single bundle (FileMaker ODBC.bundle)
in the /Library/ODBC folder. The ODBC client application loads the correct driver automatically.
To install the ODBC client driver:
1. Do one of the following:

1 If you received your software electronically, double-click the disk image icon (.dmg file).
1 If you have an installation disk, insert the disk into the drive.
2. In the FileMaker Pro or FileMaker Server window, double-click the xDBC folder.
3. In the xDBC folder, double-click the ODBC Client Driver Installer folder.
4. In the ODBC Client Driver Installer folder, double-click FileMaker ODBC.pkg.
The FileMaker ODBC Driver Installer opens.
5. Install the ODBC client driver by following the onscreen instructions.
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.

Configuring client drivers (OS X)
Before using an ODBC client application to access a FileMaker data source, you must configure
a client driver for the data source. Configuration settings identify the client driver you’re using, the
location of the data source, and details on how you intend to connect.
These instructions assume you have installed the ODBC Manager from Actual Technologies,
available at http://www.odbcmanager.net, which is a freeware product not supported by FileMaker.
Because there is only one installed bundle for both 32- and 64-bit client drivers, you can use the
same ODBC administrator for both 32- and 64-bit ODBC applications. The FileMaker DSN that
you configure can be used for both 32- and 64-bit ODBC applications.
Important When using a FileMaker client driver, you must reserve 2399 as the port.
To configure the ODBC client driver:
1. Launch the ODBC Manager utility. (The ODBC Manager is installed in the Utilities folder in the
Applications folder.)
2. Select the System DSN or User DSN tab, and click Add.
The Choose a driver dialog box opens.
3. Select FileMaker ODBC, and click OK.
The FileMaker DSN Configuration dialog box opens.

Chapter 3 | Installing FileMaker ODBC client drivers

17

4. Click Continue.
5. For Name, enter a name that will be meaningful to others accessing the FileMaker data source.
For Description, enter an optional description of the FileMaker data source. Click Continue.
6. For Host:

1 If you’re connecting to a database file hosted by FileMaker Pro on your local machine, enter
localhost or the IP address 127.0.0.1.

1 If you’re connecting to a database file hosted by FileMaker Server over a network, enter the
IP address of the FileMaker Server.

If you have enabled sharing via ODBC/JDBC in the host application, you can select Connect
to host to obtain the names of available databases. Click Continue.
Otherwise, click Finish to save your data source information.
7. 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.
If you need special handling of non-English text, click Advanced Language. The Advanced
Language Options dialog box opens.

1 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.

1 If your application uses ODBC functions with character buffers whose characters are 4 bytes
wide, select the Application uses the "wide" ODBC API option.

1 If you want the SQL_C_CHAR text type to be interpreted by the driver as the SQL_C_WCHAR
text type, select the Treat text types as Unicode option.

1 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.

Select the Describe text fields as long varchar option to correct issues with long field values,
such as fields that do not have a maximum length specified getting used for Microsoft Word Mail
Merge import, or field values in PHP applications that are longer than 255 characters.
If you want to create a log file for long-running queries, select the Save long-running queries
to a log file option, and enter the name for the log file.
Click Finish to save your data source information.

Chapter 3 | Installing FileMaker ODBC client drivers

18

8. Review the information about your FileMaker DSN.

1 Click Test to verify that you have correctly configured the ODBC client driver to access the
FileMaker data source. If you receive an error message, you can correct the connection
information. You may also need to check that the FileMaker database file is hosted and
available, that the FileMaker account specified uses a privilege set with the extended
privilege Access via ODBC/JDBC, and that the FileMaker Server or FileMaker Pro host
application has been set up for sharing via ODBC/JDBC.

1 Click Done to save your data source information.

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.
For more information on using FileMaker as an ODBC data source, see chapter 4, “Using ODBC
to share FileMaker data.”

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. See chapter 2, “Accessing external SQL data
sources,” for details about accessing an external SQL data source via ODBC.

About ODBC
ODBC is an API that enables applications to access data from many database management
systems. ODBC gives client applications a common language for interacting with data sources
and database services.
All applications that support ODBC recognize a basic subset of SQL (Structured Query Language)
statements. SQL lets you use other applications (such as spreadsheets, word processors, and
reporting tools) to view, analyze, and modify FileMaker data. See FileMaker SQL Reference for the
SQL statements, functions, and expressions that the ODBC client driver supports.
Your application can talk directly to a FileMaker database file by using the ODBC client driver. Your
SQL statements are delivered to the FileMaker host of the database file and the results of those
statements are sent back to you. If you use FileMaker Server to host a FileMaker database file as
a data source, the database file can be located on another machine (the server machine)
connected to the network, while your client application is located on your machine (the client
machine). This is referred to as a client/server configuration.
Client
Application

Driver
Manager

Oracle
ODBC Driver

SQL Server
ODBC Driver

FileMaker
ODBC Client
Driver

Oracle

Microsoft
SQL Server

FileMaker

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.

1 create a Microsoft Visual Basic application that shares information with FileMaker Pro.
To share a FileMaker database file as a data source, use FileMaker Pro to define accounts that
need access to the database file. Then, control access to the database file by assigning privilege
sets to the accounts, including the extended privilege of access via ODBC/JDBC. Finally, enable
the FileMaker Server or FileMaker Pro host application to share data via ODBC/JDBC. For details,
see FileMaker Pro Help or FileMaker Server Help.
Important Prior versions of the FileMaker ODBC client driver are not compatible with
FileMaker 13. To connect to a FileMaker 13 database file, you need to install and configure the
new ODBC client driver.
Note To confirm that the FileMaker XDBC Listener is currently running, you can use the Activity
Monitor on OS X or the Task Manager on Windows to check the status of the FileMaker XDBC
Listener process. When the process is started, it is named fmxdbc_listener, and events are logged
by that name. The FileMaker XDBC Listener process is separate from the FileMaker Server process.
You can use the FileMaker Server Admin Console to stop and start the XDBC Listener process. On
the FileMaker Server Status pane, set ODBC/JDBC to OFF to stop the XDBC Listener and set
ODBC/JDBC to ON to start the XDBC Listener.

Overview of accessing a FileMaker database file
From an ODBC-compliant application, you can construct SQL queries to access a FileMaker
database file. The ODBC client driver must be installed on the computer generating the SQL query.
To access a FileMaker database file:
1. In FileMaker Pro, review the privilege sets you’ve assigned to accounts that will access the
database file.
Accounts that need access must use a privilege set with the extended privilege of Access via
ODBC/JDBC.
2. Enable the FileMaker Server (via FileMaker Server Admin Console) or FileMaker Pro host
application to share data via ODBC/JDBC.
FileMaker Server Admin Console: Choose General Settings > ODBC/JDBC then select
Enable ODBC/JDBC.
FileMaker Pro: Choose File menu > Sharing > Enable ODBC/JDBC and set ODBC/JDBC
Sharing to On.

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.
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. The
complete field name, including any non-alphanumeric characters, displays as the column name.

Accessing a FileMaker database file from a Windows application
Specifying ODBC client driver properties for a FileMaker DSN (Windows)
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.
To configure a new ODBC client driver, see “Configuring client drivers (Windows)” on page 13.

Changing an existing ODBC client driver (Windows)
To change an existing ODBC client driver, open the correct version of the ODBC administrator.
To configure the 32-bit client driver, you must use the 32-bit ODBC administrator. To configure the
64-bit client driver, you must use the 64-bit ODBC administrator.
To open the 32-bit ODBC administrator on a 32-bit Windows operating system:
In the Windows Control Panel, open Administrative Tools > Data Sources (ODBC).
Note Administrative Tools appear in the System and Security category.
The 32-bit ODBC Data Source Administrator opens.
To open the 32-bit ODBC client driver on a 64-bit Windows operating system:
1. Open the SysWOW64 folder on your system. (By default, the SysWOW64 folder is at
c:\windows\SysWOW64.)
2. Double-click the odbcad32.exe file.
The 32-bit ODBC Data Source Administrator opens.
To open the 64-bit ODBC client driver on a 64-bit Windows operating system:
In the Windows Control Panel, open Administrative Tools > Data Sources (ODBC).
Note Administrative Tools appear in the System and Security category.
The 64-bit ODBC Data Source Administrator opens.

Chapter 4 | Using ODBC to share FileMaker data

22

To change the existing ODBC client driver:
1. In the ODBC Data Source Administrator, select the System DSN or User DSN tab (select the
tab used when you previously configured).
2. Choose the FileMaker data source that you previously configured.
The data source name you originally entered appears under Name, and FileMaker ODBC
appears as the Driver.
3. Click Configure.
The FileMaker DSN Configuration dialog box appears.
4. For Name, enter a name that will be meaningful to others accessing the FileMaker data source.
For Description, enter an optional description of the FileMaker data source. Click Next.
5. For Host, enter the location of your data source.
If you’re connecting to a FileMaker database file hosted by FileMaker Pro on your local
machine, type 127.0.0.1 (or localhost).
If you’re connecting to a FileMaker database file hosted by FileMaker Server over a network,
type the IP address of FileMaker Server.
If you’ve enabled sharing via ODBC/JDBC in the host application, select Connect to host to
obtain the names of available databases.
6. 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.
If you need special handling of non-English text, click Advanced Language. The Advanced
Language Options dialog box opens.

1 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.

1 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.

Select the Describe text fields as long varchar option to correct issues with long field values,
such as fields that do not have a maximum length specified getting used for Microsoft Word Mail
Merge import, or field values in PHP applications that are longer than 255 characters.
If you want to create a log file for long-running queries, select the Save long-running queries
to a log file option, and enter the name for the log file.
7. Click Finish to save your data source information.
8. Click Done to close the FileMaker DSN Configuration dialog box.

Chapter 4 | Using ODBC to share FileMaker data

23

Verifying access via ODBC (Windows)
To verify that you’ve correctly configured the ODBC client driver to access the FileMaker data source:
1. In the Windows Control Panel, open Administrative Tools > Data Sources (ODBC).
Note Administrative Tools appear in the System and Security category.
The ODBC Data Source Administrator opens.
2. Select the System DSN or User DSN tab (select the tab used when you previously configured).
3. Choose the FileMaker data source that you previously configured.
The data source name you originally entered appears under Name, and FileMaker ODBC
appears as the Driver.
4. Click Configure.
The FileMaker DSN Configuration dialog box appears.
5. Click Next until you reach the Conclusion page.
6. Click Test.
You are prompted to enter your FileMaker account name (in Database User Name) and
password (in Database Password).
If the connection is OK, you receive the message Test completed successfully.
If the connection fails:

1 Make sure the FileMaker database file is hosted and available.
1 Update or correct your connection information.
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. 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.
To configure a new ODBC client driver, see “Configuring client drivers (OS X)” on page 16.

Changing an existing ODBC client driver (OS X)
These instructions assume you have installed the ODBC Manager from Actual Technologies,
available at http://www.odbcmanager.net, which is a freeware product not supported by FileMaker.
Because there is only one installed bundle for both 32- and 64-bit client drivers, you can use the
same ODBC administrator for both 32- and 64-bit ODBC applications. The FileMaker DSN that
you configure can be used for both 32- and 64-bit ODBC applications.

Chapter 4 | Using ODBC to share FileMaker data

24

To change an existing ODBC client driver:
1. Launch the ODBC Manager utility. (The ODBC Manager is installed in the Utilities folder in the
Applications folder.)
2. Click the System DSN or User DSN tab.
3. Choose the FileMaker data source that you previously configured.
The data source name you originally entered appears under Name, and FileMaker ODBC
appears as the Driver.
4. Click Configure.
The FileMaker DSN Configuration dialog box opens.
5. Click Continue.
6. For Name, type a name that will be meaningful to others accessing the FileMaker data source.
An additional Description is optional.
7. For Host, enter the location of your data source.
If you’re connecting to a FileMaker database file hosted by FileMaker Pro on your local
machine, type 127.0.0.1 (or localhost).
If you’re connecting to a FileMaker database file hosted by FileMaker Server over a network,
type the IP address of FileMaker Server.
If you’ve enabled sharing via ODBC/JDBC in the host application, select Connect to host to
obtain the names of available databases.
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.
If you need special handling of non-English text, click Advanced Language. The Advanced
Language Options dialog box opens.

1 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.

1 If your application uses ODBC functions with character buffers whose characters are 4 bytes
wide, select the Application uses the "wide" ODBC API option.

1 If you want the SQL_C_CHAR text type to be interpreted by the driver as the SQL_C_WCHAR
text type, select the Treat text types as Unicode option.

Chapter 4 | Using ODBC to share FileMaker data

25

1 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.

Select the Describe text fields as long varchar option to correct issues with long field values,
such as fields that do not have a maximum length specified getting used for Microsoft Word Mail
Merge import, or field values in PHP applications that are longer than 255 characters.
If you want to create a log file for long-running queries, select the Save long-running queries
to a log file option, and enter the name for the log file.
9. Click Finish to save your data source information.
10. Click Done to close the FileMaker DSN Configuration dialog box.

Verifying access via ODBC (OS X)
To verify that you’ve correctly configured the ODBC client driver to access the FileMaker data source:
1. Launch the ODBC Manager utility. (The ODBC Manager is located in the Utilities folder in the
Applications folder.)
2. Select the System DSN or User DSN tab (select the tab used when you previously configured).
3. Choose the FileMaker data source that you previously configured.
The data source name you originally entered appears under Name, and FileMaker ODBC
appears as the Driver.
4. Click Configure.
The FileMaker DSN Configuration dialog box opens.
5. Click Continue until you reach the Conclusion page.
6. Click Test.
You are prompted to enter your FileMaker account name (in Database User Name) and
password (in Database Password).
If the connection is OK, you receive the message Test completed successfully.
If the connection fails:

1 Make sure the FileMaker database file is hosted and available.
1 Update or correct your connection information.
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.

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.com/support/downloads
If you’ll be hosting a FileMaker database file using FileMaker Server, make the client drivers
available to remote users.
After installing the client driver you need, you can configure the driver to access a FileMaker data
source and construct SQL queries to interact with the data.
The JDBC client driver is the driver portions of the FileMaker software that allow third-party
applications or custom applications to access FileMaker files as JDBC data sources.

Software requirements
To install and use the JDBC client drivers, you need JDK 1.6 or later.
To find which version of Java you’re running, open a command window (Windows) or Terminal
window (OS X) and type java -version.

Networking requirements
If you’ll be accessing a FileMaker data source hosted on another computer, you’ll need network
access via TCP/IP.

JDBC client driver installation
You must have write access to the folder where you’re installing the JDBC client driver.
To install the JDBC client driver:
1. Do one of the following:

1 Windows: If you received your software electronically, double-click the installation icon (.exe file).
1 OS X: If you received your software electronically, double-click the disk image icon (.dmg file).
1 If you have an installation disk, insert the disk into the drive.
2. In the FileMaker Pro or FileMaker Server window, double-click the xDBC folder.
3. In the xDBC folder, double-click the JDBC Client Driver Installer folder.
4. 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 OS X: Copy the fmjdbc.jar file to the /Library/Java/Extensions folder or to another folder
location included in the ClassPath of your Java application.

The JDBC client driver is now available for you to use to access a FileMaker data source.

Chapter 5 | Installing FileMaker JDBC client drivers

27

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.
For more information on using the JDBC client driver, see chapter 6, “Using JDBC to share
FileMaker data.”

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. JDBC is a low-level interface, which means that it is used to call SQL commands
directly. It is also designed to be used as a base for higher level interfaces and tools.
Your Java applet or application can talk directly to a FileMaker database file by using the JDBC
client driver. Your SQL statements are delivered to the FileMaker host of the database file and the
results of those statements are sent back to you. If you use FileMaker Server to host, the
FileMaker database file you’re using as a data source can be located on another machine (the
server machine) connected to the network, while your Java applet or client application is located
on your machine (the client machine). This is referred to as a client/server configuration.

Java application
JDBC driver

FileMaker

Client machine

Database server

Using the JDBC client driver
You can use the JDBC client driver with a Java compiler or RAD tool to connect with your database
while you build the code for your Java application or applet. After the Java application or applet
has been created, the JDBC client driver must be present with the files or included within the code
in order for the application or applet to communicate with the database.
To use the JDBC client driver, your Java application or applet must register the driver with the
JDBC driver manager and you must specify the correct JDBC URL from within the application or
applet. You need the JDBC URL to make the connection to the database.

About the JDBC client driver
The JDBC client driver provides partial support for the JDBC 3.0 specification. The following
features are not supported by FileMaker:

1
1
1
1
1

Savepoint
Retrieval of auto-generated keys
Passing parameters to a callable statement object by name
Holdable cursor
Retrieving and updating the object referenced by a Ref object

Chapter 6 | Using JDBC to share FileMaker data

1
1
1
1
1

29

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. This type of driver offers all the advantages of Java, including
automatic installation (for example, downloading the JDBC driver with an applet that uses it).
The driver class and main entry point for the driver is named:
com.filemaker.jdbc.Driver
Important The JDBC client driver replaces the FileMaker JDBC driver released with a previous
version of FileMaker. If you have previously set up access to a FileMaker data source using the
older driver, you’ll need to re-define access by using and configuring the new driver.
Note To confirm that the FileMaker XDBC Listener is currently running, you can use the Activity
Monitor on OS X or the Task Manager in Windows to check the status of the FileMaker XDBC
Listener process. When the process is started, it is named fmxdbc_listener, and events are logged
by that name. The FileMaker XDBC Listener process is separate from the FileMaker Server
process. You can use the FileMaker Server Admin Console to stop and start the XDBC Listener
process. On the FileMaker Server Status pane, set ODBC/JDBC to OFF to stop the XDBC Listener
and set ODBC/JDBC to ON to start the XDBC Listener.

Using a JDBC URL to connect to your database
In Java, most resources are accessed through URLs (Uniform Resource Locators). A JDBC URL
is used to identify the database so the JDBC client driver can recognize and establish a connection
with the database.
The JDBC URL consists of three main parts separated by colons:
jdbc::
The first part in the JDBC URL is always the JDBC protocol (jdbc). The subprotocol is the driver
name or the mechanism that supports multiple drivers. For the JDBC client driver, the subprotocol is
filemaker. The subname is the IP address of the machine that is hosting the FileMaker data source.
Registering the JDBC client driver and connecting to a FileMaker data source (an example)
Here is a portion of a JDBC client application that:
1. Registers the JDBC client driver with the JDBC driver manager.
2. Establishes a connection with the FileMaker data source. The JDBC URL is
jdbc:filemaker://192.168.1.1/database

Chapter 6 | Using JDBC to share FileMaker data

30

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.1/mydataba
se”,”username”, “password”);
} catch(Exception e) {
System.out.println(e);
}
// get connection warnings
SQLWarning warning = null;
try {
warning = con.getWarnings();
if (warning == null) {
System.out.println("No warnings");
return;
}
while (warning != null) {
System.out.println("Warning: "+warning);
warning = warning.getNextWarning();
}
} catch (Exception e) {
Sysem.out.println(e);
}
}
}þ

Note This example is not meant to be compiled.

Chapter 6 | Using JDBC to share FileMaker data

31

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.

1 user: An account in the FileMaker database file that uses a privilege set with the extended
privilege Access via ODBC/JDBC

1 password: The password for the account in the FileMaker database file
JDBC URL connection with the database name specified in the URL
Format:
jdbc:filemaker:///
Example:
jdbc:filemaker://192.168.1.1/publications
JDBC URL connection with the database name, user name, and password specified in the URL
Format:
jdbc:filemaker:///?user=&password=
Example:
jdbc:filemaker://192.168.1.1/customers?user=Collections&password=
admin
Note Because of the use of the ampersand character (&) in this syntax, you cannot use an
ampersand character in the user name or the password.
Invalid user name example:
jdbc:filemaker://localhost/sales_db?user=ad&min&password=admin
Invalid password example:
jdbc:filemaker://localhost/sales_db?user=admin1&password=ad&min

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. Then define this additional database file as your data source
in the JDBC URL. All of the FileMaker database files must be on the same computer.

Chapter 6 | Using JDBC to share FileMaker data

32

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.

To share a FileMaker database file as a data source, use FileMaker Pro to define accounts that
need access to the database file. Then, control access to the database file by assigning
privilege sets to the accounts, including the extended privilege of access via ODBC/JDBC.
Finally, enable the FileMaker Server or FileMaker Pro host application to share data via
ODBC/JDBC. For details, see FileMaker Pro Help or FileMaker Server Help.

1 The JDBC client driver registration and the JDBC URL are correct (the driver can be included
inside the Java Application or located on the client machine).

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 Meta Data functions
1
1
1
1
1
1

getColumns
getColumnPrivileges
getMetaData
getTypeInfo
getTables
getTableTypes

Mapping FileMaker fields to ODBC data types
This table illustrates how FileMaker field types map to the standard ODBC data types.
FileMaker field type

Converts to ODBC data type

About the data type

text

SQL_VARCHAR

The maximum column length of text is 1 million characters,
unless you specify a smaller Maximum number of
characters for the text field in FileMaker. FileMaker returns
empty strings as NULL.

number

SQL_DOUBLE

The FileMaker number field type can contain positive or
negatives values as small as 10-308, and as large as 10+308,
with up to 15 significant digits.

date

SQL_DATE

time

SQL_TIME

timestamp

SQL_TIMESTAMP

The FileMaker time field type can contain the time of day or
a time interval. A time interval is returned as a time of day,
unless it is less than 0 or greater than 24 hours (both return
a value of 0).

Chapter 7 | Reference Information

34

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.

String length is optional in table declarations. All strings are stored and retrieved in Unicode.
Note FileMaker repeating fields are supported like arrays. Examples:
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.
FileMaker field type

Converts to JDBC SQL type

text

java.sql.Types.VARCHAR

number

java.sql.Types.DOUBLE

date

java.sql.Types.DATE

time

java.sql.Types.TIME

timestamp

java.sql.Types.TIMESTAMP

container

java.sql.Types.BLOB

calculation

specified by the data type of the calculation’s result

The JDBC client driver converts the FileMaker calculation data type to the JDBC SQL type
matching the calculation’s result. For example, the JDBC client driver converts a FileMaker
calculation that results in a timestamp data type to java.sql.Types.TIMESTAMP.

Data types in 64-bit applications
In the 32-bit version of the ODBC API, some functions used parameters that could pass integer
values or pointer values, depending on context. But in 64-bit Windows operating systems, integers
and pointers are not the same size. The 64-bit version of the ODBC API uses abstract data types
that are not defined as a specific size.
Applications that use 32-bit values may crash when they are ported to a 64-bit operating system.
Applications that use abstract data types work correctly on both 32- and 64-bit operating systems.

Chapter 7 | Reference Information

35

ODBC and JDBC error messages
Here are the basic formats of error messages you receive when working with FileMaker and
ODBC/JDBC.

ODBC error messages
Error messages can come from:

1 ODBC driver errors
1 FileMaker and FileMaker XDBC Listener errors
FileMaker ODBC error messages
An error that occurs in the FileMaker listener or data source includes the data source name, in the
following format:
[FileMaker] [FileMaker ODBC] message
For example, you might get the following message from your FileMaker data source:
[FileMaker] [FileMaker ODBC] Invalid Username/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.
Consecutive messages for errors in different columns can sometimes display an incorrect column
name.

JDBC error messages
The FileMaker JDBC driver reports errors to the calling application by returning SQLExceptions.
Error messages can come from:

1 JDBC driver errors
1 FileMaker and FileMaker XDBC Listener errors
FileMaker JDBC error messages
An error that occurs in the FileMaker listener or data source includes the data source name, in the
following format:
[FileMaker] [FileMaker JDBC] message
For example, you might get the following message from your FileMaker data source:
[FileMaker] [FileMaker JDBC] Invalid Username/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
A

E

Access via ODBC/JDBC extended privilege 20
accounts and privileges 20
ARRAY data type 29
auto-generated keys 28

error message formats 35
Execute SQL script step 10
ExecuteSQL function 10
extended privileges 20

B

F

Boolean data type 29

fields
mapping to JDBC 34
mapping to ODBC 33
FileMaker products 7
files
organizing on one computer 7
setting up access to 20

C
CAST function 34
client application, using FileMaker as 5
CLOB data type 29
column names 21
configuring a FileMaker data source
via JDBC 31
via ODBC (OS X) 23
via ODBC (Windows) 21
container field
JDBC data type mapping 34
ODBC data type mapping 34
cursors
in JDBC 28

D
data source
configuring for access via JDBC 31
configuring for access via ODBC (OS X) 23
configuring for access via ODBC (Windows) 21
disabling a shared FileMaker database file 7
one DSN for each FileMaker database file 8
verifying access via JDBC 32
verifying access via ODBC (OS X) 25
verifying access via ODBC (Windows) 23
data source names. See DSNs
data type mapping
JDBC client driver 34
ODBC client driver 33
database, DSN 22
DATALINK data type 29
disabling a shared FileMaker database file 7
driver properties
JDBC client driver 31
ODBC client driver (OS X) 23
ODBC client driver (Windows) 21
drivers
uninstalling old 8
DSNs
creating (OS X) 23
creating (Windows) 21
one per file 8

G
GetAs function 34

H
holdable cursor 28
host, DSN 22, 24

I
Import Records script step 10
installation requirements 12, 26

J
Java Development Kit (JDK) 29
Java version 26
JDBC
client driver, described 28
described 28
error messages 35
JDBC client driver
driver class and main entry point 29
mapping data types 34
registering with the JDBC driver manager 29
specifying the JDBC URL 29
verifying access 32
JDBC Meta Data functions 33
JDBC SPI 29

M
mapping data types
JDBC client driver 34
ODBC client driver 33

37

N

U

network requirements 8
null value 33

URL (Uniform Resource Locator) for the JDBC client driver 29
using ODBC and JDBC with FileMaker 5

O

V

ODBC
described 19
error messages 35
repeating fields 34
ODBC Administrator (OS X) 25
ODBC catalog functions 33
ODBC client driver
mapping data types 33
verifying access (OS X) 25
verifying access (Windows) 23
ODBC Data Source Administrator (Windows) 24
OS X
creating a DSN 23
JDBC client driver requirements 26
ODBC client driver requirements 12
verifying ODBC access 25

verifying access
JDBC client driver 32
ODBC client driver (OS X) 25
ODBC client driver (Windows) 23

P
password
with JDBC 31
with ODBC 23, 25
port, specifying for JDBC 27
privileges, extended 20

R
Rapid Application Development (RAD) tools 28
REF data type 29
registering the JDBC client driver 29
remote access 7
repeating fields 34
requirements for installation 12, 26

S
savepoint support 28
Server Data Source 24
setting up privileges and sharing 20
sharing, setting up ODBC/JDBC 20
SQLExceptions 35
system requirements 12, 26

T
testing access
JDBC client driver 32
ODBC client driver (OS X) 25
ODBC client driver (Windows) 23

W
Windows
creating a DSN 21
JDBC client driver requirements 26
ODBC client driver requirements 12
verifying ODBC access 23

X
XDBC Listener 20, 29, 35



Source Exif Data:
File Type                       : PDF
File Type Extension             : pdf
MIME Type                       : application/pdf
PDF Version                     : 1.4
Linearized                      : Yes
Tagged PDF                      : Yes
Page Mode                       : UseOutlines
XMP Toolkit                     : Adobe XMP Core 4.0-c316 44.253921, Sun Oct 01 2006 17:14:39
Format                          : application/pdf
Title                           : FileMaker ODBC and JDBC Guide
Creator                         : FileMaker, Inc.
Create Date                     : 2013:07:24 15:10:03Z
Creator Tool                    : FrameMaker 9.0
Modify Date                     : 2013:07:24 15:10:03Z
Producer                        : Acrobat Distiller 8.1.0 (Windows)
Document ID                     : uuid:bcf1e082-1a35-4d96-8cfd-08b7aa367612
Instance ID                     : uuid:0faabed6-618e-42b8-a754-e4b421ca1fcf
Page Count                      : 37
Author                          : FileMaker, Inc.
EXIF Metadata provided by EXIF.tools

Navigation menu