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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:05:04+00:00 2026-05-14T03:05:04+00:00

I am developing a Java Desktop Application but have some confusions in choosing a

  • 0

I am developing a Java Desktop Application but have some confusions in choosing a technology for my persistence layer.

Till now, I have been using JDBC for DB operations. Now, Recently I learnt Hibernate and JPA but still I am a novice on these technologies.

Now my question is What to use for my Java Desktop Application from the following?

  • JPA

  • Hibernate

  • JDBC

  • DAO

  • any other suggestion from you…

I know that there is no best choice from them and it totally depends on the complexity and the requeirements of the project so below are the requirements of my project

  1. It’s not a complex application. It contains only 5 tables (and 5 entities)
  2. I wan’t to make my code flexible so that I can change the database later easily
  3. The size of the application should remain as small as possible as I will have to distribute it to my clients through internet.
  4. It must be free to use in commercial development and distribution.

==================================== EDITED =======================================

On the basis of the below answers, I would like to go with JPA so as to prevent myself from writing vendor-specific SQL code.

But I have some problems in JPA which are mentioned at Java Persistence API

  • 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-14T03:05:05+00:00Added an answer on May 14, 2026 at 3:05 am

    Here’s my take:

    • JPA: Agnostic way to do Java persistence without coupling your clients to Hibernate, TopLink, etc.
    • Hibernate: Good choice if you have an object model to map to.
    • JDBC: All Java persistence is built on this. Lowest level
    • DAO: More of a pattern than a technology; CRUD operation interface.
    • iBatis: Halfway between JDBC (raw SQL) and Hibernate (ORM).
    • JDO: Java Data Objects, which is another specification for Java persistence. (e.g., Apache JDO)

    It’s not a complex application. It contains only 5 tables (and 5
    entities)

    Any of these will work, but JDBC will be the simplest. All the others are built on top of JDBC.

    I want to make my code flexible so that I can change the database later
    easily

    Schema changes will have similar effects in all technologies.

    The size of the application should remain as small as possible as I will
    have to distribute it to my clients
    through internet.

    Using JPA or Hibernate will require JARs that will add to the size of your deployment. JDBC will minimize this.

    It must be free to use in commercial development and distribution.

    See licenses of all technologies. Shouldn’t be a problem with any of them.

    FYI: It’s possible to write a generic DAO interface:

    package persistence;
    
    import java.io.Serializable;
    import java.util.List;
    
    public interface GenericDao<T, K extends Serializable>
    {
        T find(K id);
        List<T> find();
        List<T> find(T example);
        List<T> find(String queryName, String [] paramNames, Object [] bindValues);
    
        K save(T instance);
        void update(T instance);
        void delete(T instance);
    }
    

    If your objects map 1:1 with your five tables, I’d say that JPA is overkill squared.

    Is your app currently on the order of 3MB JAR? If no, then Hibernate or JPA will more than double the size. You can quantify exactly how much. And there’s more than one JAR, because they both have dependencies.

    YAGNI says that you should keep it simple. It’s five tables!

    Changing vendor, if you do it properly, means switching a JDBC driver JAR, changing the driver class name, and adding the new connection URL – which you have to do no matter what technology you pick.

    I find that databases don’t change that radically. You’ll change the schema, but the entire vendor? Not likely, especially if you have several clients. It’ll be a major inconvenience to make a user base switch databases.

    Which one were you planning to ship with? HSQL or something that will require an installation like MySQL? That’s a more pertinent concern.

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

Sidebar

Ask A Question

Stats

  • Questions 491k
  • Answers 491k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer For a list of all cultures, see the documentation for… May 16, 2026 at 10:16 am
  • Editorial Team
    Editorial Team added an answer You have a RocketFeedback class and RocketFeedback module in your… May 16, 2026 at 10:16 am
  • Editorial Team
    Editorial Team added an answer You should read this : http://developer.apple.com/mac/library/documentation/cocoa/conceptual/MemoryMgmt/MemoryMgmt.html You don't need to… May 16, 2026 at 10:16 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I am developing a Java desktop application and would like to have an external
I'm developing a desktop application using Java. I want to put an icon (with
I have been using Hibernate + HSQLDB on my desktop for developing a database
I am developing a Java Desktop Application. In the GUI, I want that user
I am developing a Java Desktop Application and want a light database that can
I have a Java desktop application I wrote, and I would like a recommendation
I am primarily a Java and PHP developer and have some experience with .NET
I have been developing a test framework for a particular client/server product (COTS) that
i'm developing an application running on WebLogic 10 and of course in java. Ok,
I've been writing BlackBerry applications in Java and I'm interesting in developing widgets as

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.