• 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

How to pass a JSON string to a POST method to populate a mysql db ?

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello I am trying to create a Web service that will have a JSON string passed which will then be used to populate a mysql db using POST method. So the CURL command could be something like this :

curl -X POST -H'Content-Type:application/json'-d{"Name:Jack","LastName":"Rooney"}'http://localhost:8080/SampleWS/Name

Can you kindly point me to a starting point ? I am very new to REST WS. Any help is appreciated.

Thanks,
Regards,
Jack
 
Ranch Hand
Posts: 645
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jack,

first you need to decide on the framework you want to use for Jax-RS, there are various options like apache-cxf,Restlet,Jersey,Apache Wink,RESTeasy etc.

Once you choose the framework just follow the getting started tutorial for the same, you have very simple use case so you should be up and running soon.

Cheers
-P
 
Jack Rooney
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Praful,

I have my framework decided. I am using Hibernate/JPA and Maven. Could you please point me to a starting point. I am still stuck.

Thanks,
Regards,
Jack
 
Sheriff
Posts: 67747
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
Neither of those is a RESTful framework. Are you planning on rolling your own?
 
Jack Rooney
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I am sorry, I am very new to this topic. Here is what I am using to create my Web Service. JDK 1.6, Maven 2.2.1, Tomcat 7, Eclipse Juno (Enterprise Edition), Hibernate 3 /JPA.

Kindly let me know.

Thanks,
Jack
 
Jack Rooney
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Bear,

Kindly help me regarding this topic by seeing my PUT annotation from this post here .

Thanks,
Regards,
Jack
 
reply
    Bookmark Topic Watch Topic
  • New Topic