Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Example Code for JDBC?

Featured Replies

  • Newbies

I am trying to add the ability to export data from a 100% java database (HsqlDB) to a FileMaker 8 database in a java application. I am trying to find example java code which shows the jdbc connection specific to using jdbc with Filemaker. I'm having a hard time figuring out how to use the included jdbc driver and I'm hoping some example code would help.

Anyone know how to do this?

Thanks

PD

  • 2 weeks later...

1. Create new text file with the codes below and name it 'InsertSample.java'.

2. Compile it. [ javac InsertSample.java ]

3. Copy FileMaker JDBC client driver ('sljc.jar') to the same directory.

4. Run it. [ java -cp .:sljc.jar InsertSample ]


import java.sql.*;



public class InsertSample

{

  public static void main(String[] args)

  {

      try

      {

        // Load driver.

        Class.forName("com.ddtek.jdbc.sequelink.SequeLinkDriver");

        // Get connection.

        Connection con = DriverManager.getConnection( "jdbc:sequelink://127.0.0.1:2399;serverdatasource=DATABASE_NAME", "admin", "" );

        

        String sql = "INSERT INTO TABLE_NAME (FIELD_NAME) values ('VALUE')";

        Statement stmt = con.createStatement();

        int result = stmt.executeUpdate(sql);



        // Closing connection.

        con.close();

      }

      catch ( Exception e ) { e.printStackTrace(); }

  }

}

--

Replace the IP address, DATABASE_NAME, TABLE_NAME and FIELD_NAME as you need.

DATABASE_NAME is the name of the filemaker database file without extension.

TABLE_NAME and FIELD_NAME should be surrounded with double quotes (some particular words cause parse error).

Note that you have to configure the sharing settings of the database to allow some users to access via JDBC.

Hope this helps.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.