Python, JDBC, Filemaker 11
I was trying to connect to our Filemaker 11 database here on the excavation. We were running Filemaker Server 11 until the power supply to the server computer died. So now we’re just sharing the Database from a Filemaker 11 client runnning on another computer. Anyway I was trying to see if I could get Python to connect and allow for some handy scripting with the database. I found these instructions, which seemed good but didn’t work Filmaker 11. So I did some hunting around. For one, the jdbc driver has changed it’s now called fmjdbc.jar and not surprisingly the methods have changed as well, so I’m offering a little update on those instructions for Filemaker 11:
# You'll probably need to set your Java Home env var before running:
# $ export JAVA_HOME=/usr/lib/jvm/java (or where ever yours is)
import jaydebeapi
import jpype
URL = 'jdbc:filemaker://10.21.41.26/Your Database'
jar = r'/opt/drivers/fmjdbc.jar' #path to driver
args='-Djava.class.path=%s' % jar # this will depend a lot on your platform
jvm_path = jpype.getDefaultJVMPath()
jpype.startJVM(jvm_path, args)
conn = jaydebeapi.connect('com.filemaker.jdbc.Driver',
URL, 'username', 'pw')
curs = conn.cursor()
curs.execute('''select * from LabHead''')
print curs.fetchall()[:100]
The two main changes are to the URL and the connection method. That should work hopefully. Alas I wasn’t able to connect as the Filemaker 11 Client only allows local JDBC connections (utterly stupid!) and I couldn’t get jpype to start on Windows. But running this all from my linux computer came back with an error about not being local so I would assume it would work if you were or if you were running the full server which allowed remote connections.





“Alas I wasn’t able to connect as the Filemaker 11 Client only allows local JDBC connections (utterly stupid!) ”
This is how they stick it to you, and force you to buy the pricier Server Advanced Pro version.