Create restful webservice projects from entities in NetBeans

Source: Internet
Author: User
Tags netbeans

Distributed systems and mobile computing ... This semester's class, the name sounded not very domineering? But in fact it is restful and Android ... Sweat....... IDE or NetBeans, the first time you've heard of this IDE. Class courseware are English, egg pain, or in the blog summary under it.

Note: The version of NetBeans that I use is 8.2 needs jdk8 above only line. With the Classfish server inside, need 4.1 version, because the teacher said 4.1.1 version has a bug

Create WebService Engineering steps in NetBeans:

1. Create a Java Web project

The rest is all the way next, finish can.

2. Use the IDE's own database javadb to build the table, and then connect to the database

The goal is to create restful services directly from the entities in the database using the functionality provided by the IDE, so it must be the first to build a table and then connect to the database! Here, I built the watch with MySQL.

------>

Here my MySQL database user name and password have been configured, you can use the same if you want to configure the MySQL database connection before the line.

3. Creating an entity class from a database

This step is simply to use the IDE's function, the database table directly into the Java entity class, do not have to write their own, flattered.

Then finish.

4. Creating restful Web service services from entity classes

Continue to use the IDE's capabilities to create restful Web service services directly from entity classes.

After you leave the default option finish,restful the Web Service service is created.

5. Testing a RESTful Web service

Right-click the project, and then select Test RESTful Web Services

Then clicking Ok,ide will deploy the project and open the browser

On this page we can test whether the methods in RESTful WEB services are working correctly.

Then it's about how to create a RESTful Web services client in NetBeans, because the job requirement is to use the Android phone to access the webservice, and that part is pass,pass.

Create restful webservice projects from entities in NetBeans

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.