Created
January 5, 2017 21:19
-
-
Save jmuhlich/6eb0ca8083f74e58f16fc34e1000c691 to your computer and use it in GitHub Desktop.
Connect to FileMaker Pro Server in Python using JDBC driver via jaydebeapi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
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
What if I don't have fmjdbc.jar file?