ODBC and JDBC Developer’s Guide

Table Of Contents
Chapter 3
|
Using JDBC to share FileMaker data 21
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 =
DriverManager.getConnection("jdbc:sequelink://17.184.17.170:2399;
user=some user;password=some password",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.