Install a JDBC driver
I am trying to write a Moneydance extension which connects to a MySQL database.
This involves using the JDBC driver for MySQL. It seems that none of these JDBC drivers are available inside the Java runtime environment within Moneydance.
How can I install a JDBC driver and make it available on the classpath for use within a Moneydance extension?
Thanks
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by Kevin Stembridg... on 25 Dec, 2016 11:10 PM
Hi,
You can bundle any third-party libraries into your extension by unpacking their jars into your classes directory.
But connecting directly to a database from Moneydance instances sounds like a bad idea to me. Can I ask why you would want to do that? There may be a better way to achieve what you want.
Cheers,
Kevin
2 Posted by jugdizh on 25 Dec, 2016 11:16 PM
Essentially my extension generates a summary of expenses in a tabular format, with values expressed in any currency. Each transaction is converted from its source currency into the target currency using the exchange rate on the date of the transaction.
I have a MySQL database of historical currency exchange rates. I've written an API around that which can convert from currency X to currency Y on a given date. But that API relies on JBDC with a MySQL driver in order to fetch data from the exchange rate db.
3 Posted by Kevin Stembridg... on 25 Dec, 2016 11:42 PM
Feel free to ignore my advice here (you may have already considered these issues) but I think you should avoid direct access if you have the resources to create a web service on top of your db.
Your main issue will be maintaining backwards-compatibility if you ever want to update the API or your database schema. Bear in mind you can't force your clients to upgrade your extension, so your back end may have to support multiple versions of the client at the same time.
You will also have the ability to cache responses if you stick a web service in front of it.
You will also have more options to protect yourself from various attacks such as DDOS.
Cheers,
Kevin
4 Posted by jugdizh on 25 Dec, 2016 11:52 PM
Hmm.. yes you raise some good points. I think that's sound advice, and I will look into putting my db behind a web service. Thanks for the suggestion!
System closed this discussion on 27 Mar, 2017 12:00 AM.