Skip to content

Instantly share code, notes, and snippets.

@jmuhlich
Created January 5, 2017 21:19
Show Gist options
  • Save jmuhlich/6eb0ca8083f74e58f16fc34e1000c691 to your computer and use it in GitHub Desktop.
Save jmuhlich/6eb0ca8083f74e58f16fc34e1000c691 to your computer and use it in GitHub Desktop.
Connect to FileMaker Pro Server in Python using JDBC driver via jaydebeapi
import jaydebeapi
import pandas as pd
def cursor_to_df(cursor):
df = pd.DataFrame(cursor.fetchall())
df.columns = [d[0] for d in cursor.description]
return df
fmsHostname = 'fmprod13.med.harvard.edu'
fmFilename = 'HITS_Reagent_Tracker_2_0'
fmUser = ''
fmPassword = ''
conn = jaydebeapi.connect(
'com.filemaker.jdbc.Driver',
['jdbc:filemaker://' + fmsHostname + '/' + fmFilename, fmUser, fmPassword],
'fmjdbc.jar'
)
cursor = conn.cursor()
cursor.execute('select * from entity')
entities = cursor_to_df(cursor)
print entities.head()
@ShivamK2002
Copy link

What if I don't have fmjdbc.jar file?

@ShivamK2002
Copy link

What if I don't have fmjdbc.jar file?

@jmuhlich
Copy link
Author

It is shipped with the Filemaker software. You will need to install that then look around for the .jar file in the installation location. I don't think it can be distributed separately so I can't provide you with the file directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment