title: Hibernate or JPA or JDBC or?
body: <p>I am developing a Java Desktop Application but have some confusions in choosing a technology for my persistence layer.</p>
  
  <p>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.</p>
  
  <blockquote>
    <p>Now my question is What to use for my Java Desktop Application from the following?</p>
  </blockquote>
  
  <ul>
  <li><p>JPA</p></li>
  <li><p>Hibernate </p></li>
  <li><p>JDBC</p></li>
  <li><p>DAO</p></li>
  <li><p>any other suggestion from you...</p></li>
  </ul>
  
  <p>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</p>
  
  <ol>
  <li>It's not a complex application. It contains only 5 tables (and 5 entities)</li>
  <li>I wan't to make my code flexible so that I can change the database later easily</li>
  <li>The size of the application should remain as small as possible as I will have to distribute it to my clients through internet.</li>
  <li>It must be free to use in commercial development and distribution.</li>
  </ol>
  
  <p>==================================== EDITED =======================================</p>
  
  <p>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.</p>
  
  <p>But I have some problems in JPA which are mentioned at <a href="https://stackoverflow.com/questions/2560125/java-persistence-api">Java Persistence API</a></p>