Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java

Ruslans Melniks
Ruslans Melniks
2,867 Points

POST data from one MySQL to another.

Hi guys, I have a project I am working on, but i am having trouble with where to start. (please let me know if I am not allowed to ask these kind of questions here and I'll remove it asap).

I have some knowledge with Java web development and had a look at REST, but what would be the best steps to accomplish following:

I need to POST data from our client's dental patient management software (OpenDental) into online booking platform (Espresa - they gave us their API and I was able to test it with postman).

What would be my steps to achieve something like that?

Thank you so much everyone. Ruslan

1 Answer

It depends how and at what step you want to post the data to the other platform. Maybe provide some steps of a typical flow and highlight at what point you want to POST to the API this way we can provide some better insight. It sounds like you need to build a webservice that will hit the API endpoint of Espresa.

Ruslans Melniks
Ruslans Melniks
2,867 Points

Thank you Alexander.

So we have a clients that are dentists. They use software that's called OpenDental (I have access to MySQL). And whenever they create a new appointment within OpenDental, it has to go into Espresa (schedulling web app, I have the API and able to POST via postman) and block the same time slot in their calendar.

So my question would be - where should I start? I understand I need to enable webserver on OpenDental server, got it. Now I need to write script that gets info from OpenDental database and POSTs it into Espresa? Any suggestions on where I can get any guidance on how this can be done via Java, preferrably?

Thanks so so much Ruslan

Ruslans Melniks
Ruslans Melniks
2,867 Points

What I am currently doing - connecting to OpenDental database via JDBC. From there I will be using Spring Restful framework (don't remember the exact name) and will be doing POST into Espresa via API. Am I on a right track?

Spring is a good start. The only thing I am unsure about with your approach is how will you know a new appointment has been scheduled? So currently it sounds like you are connecting to the database with your Spring REST asking the db for data and then post that data to the API (assuming you will do that every x minutes). You need to be able to distinguish between what is old and what is new every time you ask for data.

I am assuming new appointments in the database have a 'added' date field? You will need to use that to your advantage.

Another approach, yet not sure if this is possible with the client you are working with is to have them post data to your REST service whenever they scheduled a new appointment. That way you know for sure what you are getting is new and can post it to the API.

You need to think if it will be easier to 'poll' or 'receive' the data.