• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Data transfer from desktop to cloud

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a desktop java application which has to send data to a cloud application. So i made the JSON strings of the data i need to post to the cloud app.

I am using Eclipse for development. Now i dont know how to send this data to the cloud application. How can i do that? This string will be parsed by some PHP code in the cloud application

Should i make a new Dynamic Web Project and put my existing code in that project?
How do i go forward with this?
 
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This "cloud" application is just a web application which is running on a server somewhere, isn't it? So if you want to connect to it and send it data, you should contact the developer of the application and ask how to do that.
 
Dan Foster
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ya, the cloud application is just a web application. I will have to write the PHP code to parse the JSON string as well, once i am done with the Java code of sending the JSON string.
 
Paul Clapham
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh, I see. Then you're doing it backwards. You can't answer the question of how to send data to the web application until you know how the web application works.
 
Dan Foster
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The web application will just parse the JSON string and use the data to make a visualization. I haven't written any code for it but i have the hello world page as of now in my cloud app page. I just wanted to know how can i get the data to the cloud.... like what is the general syntax to do this?
 
Paul Clapham
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There isn't any "general syntax" for sending data to a web application. What you will actually do when you get the web application designed doesn't use "syntax" either. I'm guessing that your web application is going to be requiring a request using the GET or POST methods -- you're going to have to decide which. At that point you need some Java code to send that request. You can do that using Java classes like HttpURLConnection, or you can use the Apache HttpClient package to avoid having to learn low-level HTTP details.

 
Dan Foster
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There would be sensitive user data on the desktop which should not be compromised with the web so I was thinking of pushing the data to the cloud app rather a request from the web. I am not sure whether this is possible.


 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where do you see the difference between "pushing the data to the cloud app" and "request from the web"? Both sound like they do the same. If you want to secure the data, encrypt it or send it over HTTPS; the latter is probably far easier to implement.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Dan Foster wrote:There would be sensitive user data on the desktop which should not be compromised with the web so I was thinking of pushing the data to the cloud app rather a request from the web.


What, in your thinking, is the difference?

[Edit: Ulf drew faster.]
 
Paul Clapham
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just to clarify terminology a bit: "the cloud" is really mostly a hardware concept. The idea is that there's a server somewhere, but you don't really know where and you don't really care.

And on that server in the cloud, you're going to implement a web application of some kind. This is the software part of the system. When you design this application, you don't know whether you're going to run it on the server in the room down the hall, or whether you're going to buy space from one of the cloud vendors, or from a web space supplier who doesn't use the "cloud" metaphor, and run it there. And you don't really care.

So when you're asking questions about "the cloud" you are confusing levels. Your desktop application is going to be interacting with software, in other words with the web application. So all this talk of "the cloud" is just confusing and misleading.
 
Dan Foster
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry for the confusion by mixing up the terms cloud and web.
I was thinking if the web app is pulling data from the database on the local machine then it would get access to all the columns of the db that also has some sensitive data. So it would be better to push the data from the desktop app and the web app accepts that data. But i was wrong.

Now i am using HTTPURLConnection as suggested by Paul to send the JSON string with the data that is required by the web app.

 
reply
    Bookmark Topic Watch Topic
  • New Topic