3

I am trying to select a column from Filemaker using JDBC that has a special character in it. I have seen other posts related to having spaces or other special characters in them and have tried quoting my columns but the question mark throws another kink into it because the JDBC driver seems to try and bind to it.

select "Job Number", "Job Completed?" from "ORDERS"

gives me com.filemaker.jdbc.FMSQLException: [FileMaker][FileMaker JDBC] Invalid parameter binding(s).

Trust me I'd love to just change the column name but I am hitting a legacy DB that is still being accessed from another system. Any help is appreciated.

Edit: After some experimentation I've found that this only happens when using PreparedStatement. If I just use Statement.executeQuery(sql) then I can get around the issue. Would much rather use prepared statements instead of building queries using string concatenation but at least I can move forward. Will leave this open in case anyone knows how to escape the question mark.

Andrew Wynham
  • 2,310
  • 21
  • 25

3 Answers3

0

ExecuteSQL ( "select \"Job Completed?\" from \"ORDERS\"";"";"")

Didn't read careful. The question is about JDBC ...

Jens Teich
  • 337
  • 1
  • 7
0

I'm one of the authors of WooF, a JDBC driver we wrote for FileMaker which goes through the XML publishing engine. I haven't tested this, but suspect it will work fine with oddly named fields and prepared statements. File a bug report if it doesn't and it should get fixed pretty quickly.

https://code.google.com/p/prosc-woof/

Sam Barnum
  • 10,559
  • 3
  • 54
  • 60
0

After some experimentation I've found that this only happens when using PreparedStatement. If I just use Statement.executeQuery(sql) then I can get around the issue. Would much rather use prepared statements instead of building queries using string concatenation but at least I can move forward. Will leave this open in case anyone knows how to escape the question mark.

Andrew Wynham
  • 2,310
  • 21
  • 25