Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Calling database using web Service  RSS feed

 
arusha khan
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please point me to a good example where you can create a web service and get data by connecting to the backend database.
Any good example with eclipse will be great.

Help...
Thank You

 
Jimmy Clark
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A web service is for two applications to communicate with each other. So, what you are looking for is a bit confusing.

You can simply create a Java application that connects to a database and retrieves data.

Then, you can create a web service that communicates with the application above.

Then the client applications that need data from the database use the web service to connect to the other application that retrieves the data.


client application ----> web service ----> Java application that gets data



The most important thing here is to recognize that the code of the web service does not contain the database access and data retrieval code. The code of the web service only serves to allow the two applications to communicate with each other using SOAP over HTTP. That is all.

 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Great Explanation James . AS I was looking for the purpose of using webservice in aProject
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!