Connecting Java Desktop to Cloud Interface - java

I have a Java desktop application which stores data into a SQLite db every 10 mins which is stored locally in the user's system. I have a cloud interface to visualize this data which uses PHP and MySQL.
I need to fetch data from the local db of the users. I think I will have to write a RESTful web service in Java so that the database which is locally stored is not exposed and the data is obtained by the web service.
I am a bit confused with this. Am I going in the right direction here?

You're on the right track. Your desktop application can connect to the cloud server and upload its information. You'll need to create an http request in your desktop application.

I think you should maybe approach this the other way round, rather than the web service getting data from your local system, your local system should upload its data to your cloud interface, perhaps using a RESTful web service on the server rather than the client.
Hope that helps.

Related

JavaFX application with remote DB

I'm developing a desktop application in JavaFX with login system and some data that must be saved in a remote database. The question is: What it's the best way to stablish a database connection with each user with the server? Should I use a RESTful API or connect to database using the remote host just like if it was a local DB?
What kind of data are you looking to manipulate? Depending on exactly how much control you may need over the information (and how secure it must be?) if you don't need an absolutely synchronized view of the information (re: the server side app having a persistent connection to the client which is informed on change events and such) it may be best to just build up a RESTful API to do all of your grunt work between the two.
If you're coming to the RESTful api and also have to design it I suggest giving this a good read. Best Practices for a Pragmatic RESTful API

How to access SQL database with Web App and Android App

What is the best way to have a SQL database that can both be accessed by an android device via java code and by a web app via php code?
In my mind I imagined a MySQL database somewhere on the cloud that is accessed in all the normal ways by the web app using mysqli_connect and then somehow the same database calls are made in Java inside the android app.
But after some research it appears this may not be the way to do it. What is the way to do this correctly?
EDIT: It was suggested my question was too broad. What I want then is a database of some basic financial information which is stored on the cloud which is then able to be accessed via a web app written in the LAMP stack and via an android app (with java code).
It is a really simple problem but I am not sure what the best practice for such a problem is in android (I come from a web dev background)
The standard way to access a database for mobile application is different than a normal web page/application.
Mobile devices should never run queries in the database; What you do is create a web service that does all the queries in the database and then sends back HTTP responses in xml, JSON format to the mobile device for consumption.
At the same time you can create a web client that interacts with the web service the same way your mobile app does. This way if you get erroneous data you can debug the web service without having to recompile the code in the mobile app.
Do a Google search for restful web service

Working with a cloud app and local private database

We are developing a cloud ERP product using java and want to provide the users to have an option to work either with a local database file or the database on the cloud. To some of our customers, their data is very sensitive and they do not want their data stored on web server, instead want to have the database on their own server/pc.
Will this kind of offering be technically viable, secure & effective to implement and maintain? If so, can anyone recommend the best work around for this kind of architecture where the application on our cloud server can work seamlessly with the local database?
Many Thanks
LJ
For your customers concerned with security, maybe using a local datastore such as MySQL running on a local server and a local instance of the ERP product, also running on a local server. And I would advise encrypting all sensitive columns using something like AES_ENCRYPT() -- even on this local database.
Otherwise I don't know of a way to run a hosted App with a secured local database without introducing all kinds of data vulnerabilities.

Help regarding What DBMS to use for interaction between android phone, server and database?

I am looking for some guideance in terms of what database to use server(using servlets) side of my android application.
Further down the line i will setup a website that will need to access the information from with the database.
At the moment from what i know i can use hibernate for object mapping to RDBMS or i can use JDBC for interaction with a MySql Database.
Do you guys have any best practices for using either the above or a different system for interaction between servlet and database?
If you are looking to get started quickly, you could use AppInventor, but if you want to build a backend yourself I suggest Ruby on Rails(get ubuntu if you don't have it!). Its easy to learn, easy to install, and very user-friendly.
The server and database will be handled by the Ruby on Rails framework.
Android application just acts as a client that makes request and accepts response from a Server. Server could be written using Servelets / JSP, ASP or PHP. As far as I know it doesn't matter to android client which database server is used at the server side as far as client is getting the response from the server.

Application that provides local and remote access to data

I need to develop an application with following features and want to
understand if GWT can be used to develop this application or is it the
right technology to use ?
1) Backend is in Java and uses MySQL
2) Desktop based UI to create some datafiles and data will be stored
in MySQL DB. This app will generate the data.
3) A desktop based application using which users can get access to
that database on a CD. This app will provide access to data locally
stored on a CD.
4) A web interface using which users can get access to the database
remotely. This app will provide remote access to data.
For local access also, we have the flexibility to install and run the
web server.
Should I use GWT for the UI part or should I use some thing else ? I
would like to provide common UI, look & feel for local and remote
access to data.
Please advice.
Thanks,
Deep
As you can run the web server also locally, I don't see a problem to re-use the same GWT app for both use cases.
It would be harder if your users must communicate with both the remote and local server from the same browser window/tab, at the same time. That can only be done with JSONP, which is possible with GWT, but it's not as nice as GWTRPC.

Categories