1

I am tasked with integrating a certain program, Sage 50 / PeachTree, with a third party program. I need to get data from Sage 50 and transfer it to the other program on a regular schedule. Sage 50 only has a .NET API and the third party program has a Java API, so due to this using the APIs to transfer data wouldn't be an option.

I noticed that you can connect to Sage 50 using ODBC (found out here: https://support.na.sage.com/selfservice/viewContent.do?externalId=12693&sliceId=1) and from there transfer the data to a program such as MS Access. If I could do that, then I could use the ODBC/JDBC bridge to get the data from an MS Access file using Java. However this would be a two step process that involves manually transferring it to MS Access, and I need to do it all programmatically.

I was wondering if there was a way to directly get the Sage 50 data from Java. I am really having trouble understanding what they mean by an "ODBC data source" and if that implies that I should be able to use the ODBC/JDBC bridge to get it directly like I could get it from MS Access, or if it really does need to come from something like MS Access.

kcrisman
  • 4,374
  • 20
  • 41
  • The ODBC/JDBC bridge was removed in Java 8. Note that in earlier version you wouldn't need to go to Access first, you would be able to query the ODBC datasource directly from Java. But given its removal, you will need to find a library that interfaces with ODBC from Java, and those questions are off topic. – Mark Rotteveel Dec 14 '16 at 14:49
  • To add to what Mark said, my attempts to connect with earlier versions of the JDBC were unsuccessful, even though I have done literally hundreds of ODBC connections through VB.Net & C# - Go with Mark's advice and do a search for Java ODBC libraries. – vbnet3d Dec 14 '16 at 14:53

1 Answers1

0

You can easily connect to an access file with ucanaccess if you go that rout:

http://ucanaccess.sourceforge.net/site.html

Download the jar and configure the connection in the context.xml of tomcat (assuming you are using tomcat)

This may be easier than trying to do the direct ODBC connection.

 <Resource name="jdbc/ACCESS"
 auth="Container"
 type="javax.sql.DataSource"
 maxActive="100"
 maxIdle="30"
 maxWait="10000"
 testOnBorrow="true"
 driverClassName="net.ucanaccess.jdbc.UcanaccessDriver"
 url="jdbc:ucanaccess:///projects/DB/access.accdb"/>
JonnyD91
  • 85
  • 6