rajesh
rajesh

Reputation: 1

Java Web Service to connect to a mysql database

Guys i need to develop a JAVA web service which reads data from a HTML form and stores the data into the MYSQL database. i have no idea about how to achieve this. Can someone give me a detailed step by step explanation as to how i should proceed.

i know i can do it using servlets. But my requirement is that it has to be done only through a web service

Upvotes: 0

Views: 2413

Answers (1)

Homo Filmens
Homo Filmens

Reputation: 116

So , first of all you have to create a structure like this :

  1. DAO for storing and retrieving data from DB
  2. Web Service exposes methods to save datas (simply calling dao and passing data)
  3. Your web app with html form. Submitting your form you have to call a servlet to manage received data. On this servlet simply call the web service client.

Take a look at this : https://netbeans.org/kb/docs/websvc/jax-ws.html if this is your first web service

Upvotes: 1

Related Questions