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

  • SEARCH
  • Home
  • 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 9236411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:17:10+00:00 2026-06-18T07:17:10+00:00

I am developing Android application which Gets and Posts data to database through REST

  • 0

I am developing Android application which Gets and Posts data to database through REST service. I have configures REST service with Jersey and Tomcat in Java.

I created single database connection when REST service starts.Now all the android clients using the single database connection.Now i just want to know is it good practice to use single database connection in my scenario..Can single database connection can entertain more than one concurrent requests ??

Kindly suggest….

Updated
When i test following scenario ,it gives different results..i just configured simple REST server with tomcat using Jersey with Get annotation only, inside this annotation i write the code to get the name of employee whose id is 300 using database connection which was established when REST was started..so that when i write http://192.168.15.9:8080/Rest/rest/person/sample on my web browser i got employee name…Then i created batch file to open the url in 100 tabs, i executed the batch file. At same time i open the url from my virtual machine and got the employee name with no delay..Also employee name is displayed in 100 tabs after 20 seconds..If single database connection can not be used for concurrent users then why i gives response rapidly ?? Can any one please explain ??

  • 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-18T07:17:12+00:00Added an answer on June 18, 2026 at 7:17 am

    No, a single database connection should not be used for concurrent requests. You should create a connection pool (basically a set of reusable connections), take a connection from the pool as needed, and then release it to the pool.

    Don’t do it yourself!

    Since you have Tomcat, you can configure a JDBC data source and then use JNDI to get a reference to this data source. A data source will provide you with connections, without you having to create connections by yourself. Tomcat will pool (activate, maintain and dispose) connections under the hood.
    Alternatively, you can use a custom connection pooler like c3p0, but I strongly advice you to use the facilities provided by your server.

    If, for any reason, you have to deploy your product within a few minutes (so you have no time to set-up a data source), then you better open and close connections for every request – which is wasteful – rather than sharing a single connection across all requests.

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

Sidebar

Related Questions

I'm developing an android application which uses web service to get data from server,
I am developing an android application in which i have a database table and
I am developing an android database application in which i have to add multiple
Am developing an android web application which have to access an database in the
I'm developing an android application which uses background service. I have not had much
I am developing an Android application in which all data come through PHP web
I'm currently developing an Android application which needs to receive data from a bluetooth
I'm developing an Android application which sends content to a server using rest web
I am developing android application in which i have to open option menu from
I am developing an Android application which needs to access QuickPay's service ( https://secure.quickpay.dk/form

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.