ODBC and JDBC Developer’s Guide
Table Of Contents
- Chapter 1 Introduction
- Chapter 2 Using ODBC to share FileMaker data
- Chapter 3 Using JDBC to share FileMaker data
- Chapter 4 Supported standards
- Appendix A Mapping FileMaker fields to ODBC data types
- Appendix B Mapping FileMaker fields to JDBC data types
- Appendix C ODBC and JDBC error messages
- Index
20 FileMaker ODBC and JDBC Developer’s Guide
About the JDBC client driver
The JDBC client driver is a JDBC 3.0 API compatible driver designed to work with the Java Development Kit
(JDK) 1.4. 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 will work with
JDK 1.3 and Java
2 as long as you only use JDBC 1.2 calls in a Java 2 environment
The driver class and main entry point for the driver is named:
com.ddtek.jdbc.sequelink.SequeLinkDriver
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.
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:<subprotocol>:<subname>
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
sequelink. 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 an example using JDBCTest 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:sequelink://
17.184.17.170:2399)
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.ddtek.jdbc.sequelink.SequeLinkDriver").newInstance();
} catch(Exception e) {
System.out.println(e);
}
// establish a connection to FileMaker
Connection con;
try {
con =