Page 2 of 2 FirstFirst 12
Results 21 to 29 of 29
Like Tree1Likes

Thread: Advantage Hibernate over JDBC

  1. #21
    Join Date
    Apr 2014
    Location
    http://www.roytuts.com
    Posts
    51
    Rep Power
    0

    Default Re: Advantage Hibernate over JDBC

    With hibernate you can write db independent queries, can you do it with jdbc ?

    why do you write insert queries, work with model objects. Hibernate has powerful api like Criteria, you do not almost need to write query.

    Use HSQL then you will find what is the advantages of Hibernate. Of course Hibernate is a little bit slower than JDBC.

    Using HSQL you need to change only the Hibernate Dialect for different database but you can use the same query for any database.

    Hibernate was invented for mainly Java/JEE developers so that these developers do not need to concentrate on SQL queries.

    You can find more information on the appropriate URL.

  2. #22
    jmohandos304 is offline Senior Member
    Join Date
    Apr 2014
    Posts
    122
    Rep Power
    0

    Default Re: Advantage Hibernate over JDBC

    Ok. Lets assume there are 100’s of tables say Table1, Table2 ….Table100. The tables contain details of employees.

    And say Table1 contains ‘a1’,’b1’,’c1’…’z1’
    Table2 contains ‘a2’,’b2’,’c2’………’z2’
    and so on till Table100

  3. #23
    jmohandos304 is offline Senior Member
    Join Date
    Apr 2014
    Posts
    122
    Rep Power
    0

    Default Re: Advantage Hibernate over JDBC

    testing

  4. #24
    jmohandos304 is offline Senior Member
    Join Date
    Apr 2014
    Posts
    122
    Rep Power
    0

    Default Re: Advantage Hibernate over JDBC

    Now let see the implementation in JDBC and Hibernate. Lets see where the advantage is, in Hibernate(Unfortunately I don't seem to find any reduction in code). The question is below the code.

  5. #25
    jmohandos304 is offline Senior Member
    Join Date
    Apr 2014
    Posts
    122
    Rep Power
    0

    Default Re: Advantage Hibernate over JDBC

    test

  6. #26
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    12,059
    Rep Power
    25

    Default Re: Advantage Hibernate over JDBC

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  7. #27
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    26

    Default Re: Advantage Hibernate over JDBC

    Quote Originally Posted by jmohandos304 View Post
    Now let see the implementation in JDBC and Hibernate. Lets see where the advantage is, in Hibernate(Unfortunately I don't seem to find any reduction in code). The question is below the code.
    And there's your problem.
    You seem to be fixated on "reduction in code", without taking in any of the other stuff people have brought up.

    Hibernate handles relationships.

    Try and model this in JDBC, and be sure to keep the 1 to many relationship in synch.

    Java Code:
    public class Job {
        private Integer id;
        private List<Record> records;
        // and other fields
    }
    
    public class Record {
        private Integer id;
        private Job job;
        // and any other fields
    }
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  8. #28
    ark
    ark is offline Senior Member
    Join Date
    Apr 2015
    Posts
    288
    Rep Power
    5

    Default Re: Advantage Hibernate over JDBC

    What is the advantages of hibernate over Data JPA (JPA respository implementation)?
    I should to write client for server, where JPA are used, indeed to repository methods yet implemented.
    Indeed I have one important question for me now. If entity classes i decorated with @entity, @table, @ID, @column annotations -- should I annotate the same classes on client side, whose objects would be generated from UI, and send for the persistence, and hadlling for server, and send back to UI for display?

  9. #29
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    26

    Default Re: Advantage Hibernate over JDBC

    The only classes you need to annotate are the ones that JPA uses.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Page 2 of 2 FirstFirst 12

Similar Threads

  1. advantage of using thread
    By simorgh in forum Threads and Synchronization
    Replies: 3
    Last Post: 02-18-2010, 05:53 AM
  2. How Hibernate is good rather than jdbc
    By sreehari556@gmail.com in forum Advanced Java
    Replies: 5
    Last Post: 12-17-2009, 08:41 AM
  3. Replies: 7
    Last Post: 09-16-2008, 06:20 PM
  4. Performance Hibernate against jdbc api
    By javadev in forum JDBC
    Replies: 2
    Last Post: 06-05-2008, 03:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •