AnsweredAssumed Answered

Can't update required field through jdbc

Question asked by aditsu on Dec 21, 2010
Latest reply on Apr 4, 2012 by TSGal

Summary

Can't update required field through jdbc

Product

FileMaker Server

Version

11

Description of the issue

With FMS 11 I can't even prepare a statement that updates a required text field. I have the same problem with the 11.2.70 and 11.3.76 drivers.
It was never a problem with FMS 8.

Steps to reproduce the problem

Create a table "test" with 2 text fields "field1" and "field2". Make "field2" required (not empty).
Then run this program (with the appropriate adjustments for the connection information):


import java.sql.Connection;
import java.sql.SQLException;

import com.filemaker.jdbc3.J3SimpleDataSource;

public class FMTest {
     public static void main(final String... args) throws SQLException {
          final J3SimpleDataSource ds = new J3SimpleDataSource();
          ds.setServerName("fms11");
          ds.setDatabaseName("test");
          ds.setUser("admin");
          final Connection conn = ds.getConnection();
          conn.prepareStatement("UPDATE test SET field1=?");
          System.out.println("ok");
          conn.prepareStatement("UPDATE test SET field2=?");
          System.out.println("ok");
     }
}

Expected result

ok
ok

Actual result

ok
Exception in thread "main" com.filemaker.jdbc.FMSQLException: [FileMaker][FileMaker JDBC] FQL0013/(1:16): Incompatible types in assignment.
     at com.filemaker.jdbc.FM_API.prepare(Unknown Source)
     at com.filemaker.jdbc.FM_API.prepare(Unknown Source)
     at com.filemaker.jdbc1.CommonJ1Statement.(Unknown Source)
     at com.filemaker.jdbc2.CommonJ2Statement.(Unknown Source)
     at com.filemaker.jdbc3.CommonJ3Statement.(Unknown Source)
     at com.filemaker.jdbc3.J3PreparedStatement.(Unknown Source)
     at com.filemaker.jdbc3.J3Connection.prepareStatement(Unknown Source)
     at com.filemaker.jdbc2.CommonJ2Connection.prepareStatement(Unknown Source)
     at FMTest.main(FMTest.java:15)

Exact text of any error message(s) that appear

see "actual result"

Configuration information

The server is running on a mac. I don't know what else could be relevant.

Workaround

Use a real database server, NOT filemaker.

Outcomes