Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7934119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T21:32:47+00:00 2026-06-03T21:32:47+00:00

I am trying to develop my first restful service in Java and having some

  • 0

I am trying to develop my first restful service in Java and having some trouble with mapping the methods to CRUD functionality.

My uri structure is as follows and maps to basic database structure:

/databases/{schema}/{table}/

/databases is static

{schema} and {table} are dynamic and react upon the path parameter

This is what I have:

Method - URI        - DATA      - Comment
---------------------------------------------------------------------
GET    - /databases - none      - returns a list of databases
POST   - /databases - database1 - creates a database named database1
DELETE - /databases - database1 - deletes the database1 database
PUT    - /databases - daatbase1 - updates database1 

Currently in the example above I am passing through the database name as a JSON object. However, I am unsure if this is correct. Should I instead be doing this (using DELETE method as an example):

Method - URI                  - DATA - Comment
---------------------------------------------------------------------
DELETE - /databases/database1 - none - deletes the database with the same name

If this is the correct method and I needed to pass extra data would the below then be correct:

Method - URI                  - DATA      - Comment
---------------------------------------------------------------------
DELETE - /databases/database1 - some data - deletes the database with the same name

Any comments would be appreciated

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T21:32:48+00:00Added an answer on June 3, 2026 at 9:32 pm

    REST is an interface into your domain. Thus, if you want to expose a database then CRUD will probably work. But there is much more to REST (see below)

    REST-afarians will object to your service being RESTful since if does not fit one of the key constraints: The Hypermedia Constraint. But, that can be addressed if you add links to the documents (hypermedia) that your service will generate / serve. See the Hypermedia constrain. After this your users will follow links and forms to change stuff in the application. (Database, tables and rows in your example) :

    - GET /database -> List of databases
    - GET /database/{name} -> List of tables
    - GET /database/{name}/{table}?page=1 -> First set of rows in table XXXXX
    - POST /database/{name}/{table} -> Create a record
    - PUT /database/{name}/{table}/{PK} -> Update a record
    - DELETE /database/{name}/{table}/{PK} -> Send the record to the big PC in the sky..
    

    Don’t forget to add links to you documents!

    Using REST for CRUD is kind of like putting it in a Straitjacket 🙂 : Your URIs can represent any concept. Thus, how about trying to expose some more creative / rich URIs based on the underling resources (functionality) that you want your service or web app to do.

    Take a look at at this great article: How to GET a Cup of Coffee

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

im trying to develop a social networking application and im having some trouble showing
I'm having some trouble trying to develop a regular expression which will pick out
I am learning to develop some RESTful code, and I faltered at the first
While trying to develop my first VS Addin, I am having issues in firing
Im trying to develop my first ASP.NET MVC web app and have run into
I'm trying to develop my first XNA game by my own hands, just looking
I am trying to develop my first spring application and deploy it to tomcat
I am trying to develop my first Android app through the ADT plugins for
I am trying to develop a program wherein which the first screen contains a
I'm trying to develop a simple IRC bot. First I want to think out

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.