Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Databases / September 2005

Tip: Looking for answers? Try searching our database.

JDBC vs Hibernate

Thread view: 
Sandy - 08 Sep 2005 16:26 GMT
Hi,
I am developing an application where i need to write XML data in database
tables.
Is there any way in Hibernate so that i don't need to create DAO objects in
by code, i.e. it automatically create DAO's from XML and update in database.

Also, Which approach is faster, using hibernate or using plane JDBC update
queries.
i feel hibernate is an overhead as internally it will also generate JDBC
queries.
Luke Webber - 09 Sep 2005 02:04 GMT
> Hi,
> I am developing an application where i need to write XML data in database
[quoted text clipped - 6 lines]
> i feel hibernate is an overhead as internally it will also generate JDBC
> queries.

It really depends on a number of factors. Do you really want database
indepence, or are you happy to stick with one DBMS? How complex is the
SQL going to get? Do you need automatic dirty checking and optimistic
locking?

Undoubtedly Hibernate is an overhead, if not in performance, then in the
amount of time required to learn it and to apply that learning. It will
also mean that anybody wanting to maintain your app will need to know
Hibernate. I'd think carefully before making that decision.

Luke
Sandy - 09 Sep 2005 06:29 GMT
> > Hi,
> > I am developing an application where i need to write XML data in database
[quoted text clipped - 11 lines]
> SQL going to get? Do you need automatic dirty checking and optimistic
> locking?

My application is fairly simple, its using one database only that will never
change.
I just need to put the data in tables, thats all, no further SQL queries.
and there are no objects which are mapping to two different tables (so i
don't need complex SQL logics)

I feel JDBC is better (performance and development time wise) than hibernate
in my case.

Is there any other thing that i should consider before making the
decision.......

> Undoubtedly Hibernate is an overhead, if not in performance, then in the
> amount of time required to learn it and to apply that learning. It will
> also mean that anybody wanting to maintain your app will need to know
> Hibernate. I'd think carefully before making that decision.
>
> Luke
Luke Webber - 09 Sep 2005 07:23 GMT
>>It really depends on a number of factors. Do you really want database
>>indepence, or are you happy to stick with one DBMS? How complex is the
[quoted text clipped - 12 lines]
> Is there any other thing that i should consider before making the
> decision.......

I think you've answered your own question. JDBC is fine for your needs.
No point in adding extra layers and increasing complexity.

Luke
Sandy - 09 Sep 2005 07:29 GMT
> >>It really depends on a number of factors. Do you really want database
> >>indepence, or are you happy to stick with one DBMS? How complex is the
[quoted text clipped - 17 lines]
>
> Luke

How about using OPENXML vs JDBC (performance wise)
I read somewhere that OPENXML is faster, (I have the XML file in memory
already, my application is generating an XML file)

Is it a better option than writing data Row by Row in tables.

So I can use it likle this
String exec =
       "DECLARE @_hDoc int "+
       "EXEC sp_xml_preparedocument @_hDoc OUTPUT, "+
       "N'<ROOT> "+
       " <DataSource Device=\"D1\" Community=\"PUBLIC\" > "+
       " </DataSource> "+
      "</ROOT>'" +
       "INSERT DataSource SELECT * FROM OPENXML(@_hDoc,
N'/ROOT/DataSource') WITH DataSource "+
       "EXEC sp_xml_removedocument @_hDoc";

Statement s = connection.createStatement();
Luke Webber - 09 Sep 2005 15:10 GMT
> How about using OPENXML vs JDBC (performance wise)
> I read somewhere that OPENXML is faster, (I have the XML file in memory
[quoted text clipped - 15 lines]
>
>  Statement s = connection.createStatement();

I haven't the faintest idea. FWIW, I'm not at all convinced that it's a
good idea to store raw XML in a database except in very limited cases.

If you want to discuss JDBC vs OpenXML, I suggest you start a new
thread. Perhaps somebody with OpenXML qualifications will see fit to
make a contribution.

Luke
Alfred - 27 Sep 2005 16:17 GMT
> My application is fairly simple, its using one database only that will never
> change.
[quoted text clipped - 4 lines]
> I feel JDBC is better (performance and development time wise) than hibernate
> in my case.

It seems you are right. In your case Hibernate would be oversized.
Hibernate supports a lot of features in more complex application.
But you don't need it.

Good luck
Zsolt Koppany - 28 Sep 2005 06:35 GMT
Try ibatis, fast and simple and very close to JDBC.

zsolt

>> My application is fairly simple, its using one database only that will
>> never
[quoted text clipped - 12 lines]
>
> Good luck


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.