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 7611175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T01:36:06+00:00 2026-05-31T01:36:06+00:00

As part of a project, I have to develop a web application and a

  • 0

As part of a project, I have to develop a web application and a server written in Java.
I am familiar with JPA and the H2 database under Netbeans, so I’d like to use both in my project.

My question is: Is it possible to use the same database in a web and desktop application with JPA and H2 as the database, without Tomcat & Glassfish as described in this link ?

Edit: I thought tomcat is a DBMS as H2 database, Mysql …the answer is simply yes, I Can use the same database for both…but i need to use tomcat, glassfish or any kind of web container (Server Application) only for the web application,the DBMS is an independent thing: I can use H2, apach derby…

for JPA I must follow the tutorial described in the link.

  • 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-05-31T01:36:07+00:00Added an answer on May 31, 2026 at 1:36 am

    Your question isn’t completely clear, so let me guess:

    • you can reuse the same h2 database, but it has to work in server mode, not accessing the disk directly. This way both the web application and your desktop app will use the sama data source at the same time.

    • you can also reuse datbase-related code (entities, DAOs), etc. JPA spec. is not coupled with Java EE, you can easily use it in standalone application. Simply extract database-code into a separate artifact (if you have been following MVC or any other sane architecture, it should be simple) that does not have dependencies on servlets/controllers.

    UPDATE: So it seems there was a major misconception in your understanding of the stack. You need: databse server (DBMS) like h2, apache-derby or full-blown like mysql or oracle. Your application communicates with a database and is deployed to an application server/servlet container like tomcat or glassfish. Fianlly jpa is used to ease the database access.

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

Sidebar

Related Questions

I have a database project (.dbp) open in Visual Studio 2008 as part of
I'm using Ruby on Rails to develop a web application. I have a wiki
I have been developing a project that I absolutely must develop part-way in C++.
I have a project asking me to develop a database along with a website
As part of a project I have assigned myself as a way of improving
I have a project which as part of the build process creates an XMLBeans
I have a SharePoint WebPart project in visual studio. As part of the project
I ask this question in anticipation as part of a project. I have experience
i have part of Asp.NET 1.1 project. I work with remote site, which works
I have been pouring through documentation as part of my quarter long project to

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.