How To: FileMaker as a Dataprovider (Custom XML JDBC Driver)

I receive this error:

com.servoy.j2db.persistence.RepositoryException: java.lang.IllegalArgumentException: Unknown search term operator -1

It seems that the driver doesn’t understand the “IN” statement. :cry:

Hello Scott

Can`t seem to get connection set up anymore to a FMP 6 file.

Server name: dpd_1av0
Username: All
Password : All
Database Server URL: jdbc:ddc://192.168.80.10/DPD_1av0;pk=ID
Driver: com.ddc.drivers.fmpxml.Driver

Servoy just hangs when OK is pressed!!

Loginfo: com.ddc.drivers.fmpxml.txt

http://192.168.80.10/fmi/xml/FMPXMLRESULT.xml?-max=0&-dbnames

Any clue what I`m doing wrong here?

info:
Version R2 2.2.5-build 337
Java version 1.5.0_06-b05 (Windows XP)
FileMaker Pro 6.04v4
webpublishing enabled port 80
latest posted driver (29-06-06 8:46 pm) used
FileMaker Filename DPD_1av0.fp5 opened on local machine with IP 192.168.80.10 and PK = ID (text field)

Also tried the following connection strings
jdbc:ddc://192.168.80.10/DPD_1av0.fp5?fmversion=6;pk=ID
jdbc:ddc://192.168.80.10/DPD_1av0?fmversion=6;pk=ID

Hoping to get this working soon. Great Job Scott.

Kind regards Rene

Hi Rene,

First thing I noticed is that you are using FM6, so you need to add port 591 onto the connection string. So try…

jdbc:ddc://192.168.80.10:591/DPD_1av0;pk=ID 

If that doesn’t work…

Just to verify the web publishing is setup and running, can you paste the url from com.ddc.drivers.fmpxml.txt into your web browser. If it works, you should see some XML in your browser that shows the list of database names. It must also list your database name that you are trying to connect to inside of the XML…so in your case, it is “DPD_1av0”.
To give you an example, It should look just like this link

http://207.250.149.56/fmi/xml/FMPXMLRESULT.xml?-max=0&-dbnames

where I am publishing Onlinelink, and xJDBCTest.

If you don’t see XML in your browser, then double check that you have web publishing setup correctly in FileMaker.

If you do see XML in your browser on your link, then can you send me the Servoy log? It is a file named “.log.txt” in the Servoy folder. That should show the error. However Servoy clears the log each time developer is restarted…so you’ll need to open Servoy, try to make the connection, and then send the log.

I have updated the Driver today. Below is a listing of fixes…

-Saving record modifications (editing records)
-Wildcard searches
-Deleting records
-Running a Stored Procedure (aka FileMaker Script) without parameters. code below

//Execute a stored procedure
var maxReturnedRows = 100;//useful to limit number of rows
var procedure_declaration = 'myScript'  //the exact name of your fileMamer script
var args = new Array()
var typesArray = new Array()
var dataset = databaseManager.executeStoredProcedure(currentcontroller.getServerName(), procedure_declaration, args, typesArray,maxReturnedRows);

The are still some problems displaying dates, timestamps, and numbers, but as log-out pointed out, you can set the display type to Text_Area (corrected), and they will display (edit and search still have issues).

Updated driver is at http://www.dnacenter.com/servoy/fm_driver.html

Great!! I’ll test the driver now.

but as log-out pointed out, you can set the display type to Text_Field

You have to set the display type to TEXT_AREA

goldcougar:
I have updated the Driver today. Below is a listing of fixes…

-Saving record modifications (editing records)
-Wildcard searches
-Deleting records
-Running a Stored Procedure (aka FileMaker Script) without parameters. code below

Hi Scott.

First of all: excellent job. :-)

A couple of questions:
is there a way to display the images present in container fields?
I tried to fill it on Fm and from Servoy, but Servoy doesn’t show the contents.

Is record creation from Servoy supported? I managed to create new records using a stored procedure (a fm script that creates the new record), but using controller.newRecord and filling it doesn’t work (the data are not saved in the backend).

PS: i was testing with FM6 italian.
PPS: If a layout has spaces in its name, the db connection won’t work

Riccardino, I’m glad you’ve found the driver useful!

Is there a way to display the images present in container fields?
I tried to fill it on Fm and from Servoy, but Servoy doesn’t show the contents.

I had actually never planned to make Container Fields or Repeating Fields work. I just don’t know if it is possible, but is worth looking into

Is record creation from Servoy supported? I managed to create new records using a stored procedure (a fm script that creates the new record), but using controller.newRecord and filling it doesn’t work (the data are not saved in the backend).

Record creation at this point isn’t supported…but is hopefully coming. I’ve got a bug list at http://www.dnacenter.com/servoy/fm_driver.html . Currently it contains.

-Display issues with numbers, dates, and timestamps.
      Work-around is to use text area display on the field
-New records
-Sorting

If a layout has spaces in its name, the db connection won’t work

I don’t normally use spaces in layout names, so I never noticed that. Hopefully it isn’t a problem for people to change their layout names. If it becomes a major problem, I can see if there is a work-around.

goldcougar:

If a layout has spaces in its name, the db connection won’t work

I don’t normally use spaces in layout names, so I never noticed that. Hopefully it isn’t a problem for people to change their layout names. If it becomes a major problem, I can see if there is a work-around.

No: definitely is not a mojor problem. But when you create a brand new layout, spaces are put by default and it could be difficult to spot the problem.
I think that just a note about it is enough… :-)

I think that just a note about it is enough…

I have added that to the Tips Section

I have also moved the project over to Google. The homepage is on googlepages, and the code is Open Source on the new Google Code.

Project Homepage: http://goldcougar83.googlepages.com/
Google Code: Google Code Archive - Long-term storage for Google Code Project Hosting.

I have a few modifications left in the plugin, and then I will consider it complete. If other Java developers would like to continue to improve this JDBC driver, please connect to Google Code’s Subversion server at the URL above and make your changes.

The driver has been updated to add the ability to filter out some layouts by name. Some of you may have noticed that when you have a large number of layouts, it takes a while to load because each layout is considered a different table.

layFilter. Filter layouts starting with this parameter.

  • Example:
    jdbc:ddc://192.168.0.0/xJDBCTest;pk=key;layFilter=servoy
    (only shows layouts where the layout name starts with ‘servoy’)

**Format is still the same, use “;” as separaters for the optional “pk” and “layFilter” parameters. Updated 8/8/06

I’m trying to get this to work with Servoy 3.1 and FMSA 8, and I’m having no luck. I’ve followed the intructions to the letter, but when I try to create the DB Servers connection, I get the error:

org.apache.commons.dbcp.DbcpException: com.ddc.drivers.fmpxml.FileMakerException: 802: Unknown error (JDBC URL: null / SQL statement: null )
com.ddc.drivers.fmpxml.FileMakerException: 802: Unknown error (JDBC URL: null / SQL statement: null )

I’m connecting to the machine that has our web server and Web Publishing Engine, which is different from our Filemaker Server machine. The instructions don’t mention a port number - 80? 591? 2399? I’ve opened all of these on our firewall, but still no connection.

Bill

If it is FM 8, it should run over port 80. Try typing in this URL, and see what it shows. You should get a list of database names, otherwise something is incorrect in your FileMaker Server setup…
Replace 192.168.1.10 with the IP of your Server Advanced Box.
http://192.168.1.10/fmi/xml/FMPXMLRESULT.xml?-max=0&-dbnames

Ok, I figured it out. The xml extended privilege needs to be enabled in the Filemaker database. Now I get a connection, tables (layouts), fields, and data.

So, if I understand correctly, this driver uses the XML interface of Filemaker, and not the JBDC interface? Or does it use both?

Thanks,
Bill

It is a custom JDBC driver that uses XML to get and send data to the FileMaker server. So, Servoy issues a SQL query, the JDBC driver converts that into a URL and sends that to the FileMaker Web Publishing server, which returns back XML. The Driver then parses that XML and returns it back to Servoy.

still no luck setting up a small FM6 test file, as a db

in a browser, this does work:
http://localhost:591/FMPro?-format=-fmp_xml&-dbnames

but, in a browser, this returns “not implemented”
http://localhost:591/fmi/xml/FMPXMLRESU … 0&-dbnames

in Servoy Version 3.1.3, db Server Config, I try:
jdbc:ddc://localhost:591/jdbc_test.fp5;pk=serial_number&fmversion=6

which returns, in the FM Access.log
127.0.0.1 - “POST /fmi/xml/FMPXMLRESULT.xml HTTP/1.1” 501 3386 in

and returns, in the servoy.log
java.io.IOException: Server returned a 501 (Not Implemented) error.
If you are using FileMaker 6, be sure to add ?&fmversion=6 to the end of your JDBC URL.

at com.ddc.drivers.fmpxml.FmXmlRequest.doRequest (FmXmlRequest.java:101)

at com.ddc.drivers.fmpxml.FmMetaData.(FmMetaData.java:31)
at com.ddc.drivers.fmpxml.FmConnection.getMetaData(FmConnection.java:159) … 13 more

greg

Looks like it isn’t recognizing the FM Version.
How about trying this for the URL:

jdbc:ddc://localhost:591/jdbc_test.fp5&fmversion=6;pk=serial_number

thanks, but still no good …

after about 2 hours of trial & error, I finally got this to work with FM6:

jdbc:ddc://localhost:591/?&fmversion=6;jdbc_test.fp5;pk=serial_number

it also works with FM5.5v2, using fmversion=5

however, it appears the Servoy 3.1.3 form can only display TEXT. Numbers, dates & time are blank. BUT, if I then export as CSV, all the data is there

feature request:
it would help a LOT, if the Servoy preferences / “db servers” tab allowed us to save a db setup, even if it fails, so we can try it again, and again, later!

PS
are you with servoy, or dna labs?

gdurniak:
feature request:
it would help a LOT, if the Servoy preferences / “db servers” tab allowed us to save a db setup, even if it fails, so we can try it again, and again, later!

You can already by deselecting the enabled checkbox.
It will then simply save and not check the connection.

Hope this helps.

after about 2 hours of trial & error, I finally got this to work with FM6:

jdbc:ddc://localhost:591/?&fmversion=6;jdbc_test.fp5;pk=serial_number

How about:
jdbc:ddc://localhost:591/jdbc_test.fp5?fmversion=6;pk=serial_number

however, it appears the Servoy 3.1.3 form can only display TEXT. Numbers, dates & time are blank. BUT, if I then export as CSV, all the data is there

This is a known bug that you can see the work-around to in the other replies in this same thread. I think you just set the display type to textarea.

are you with servoy, or dna labs?

When I originally wrote/modified this driver, I worked for DNA Diagnostics Center. Since February, I have been working for Servoy USA.

sorry, I’m not about to try any more connection strings! :slight_smile:
isn’t the proper format hidden somewhere in the source code? I haven’t had time to look

and yes, Text Area does work

for years now, we have offloaded data from FileMaker to Sybase, then queried Sybase to run large number crunching reports

with this new jdbc connection, I hope to use servoy to coordinate this process

thanks
greg