Please join us at the new JavaWorld Q&A Forums. Your existing login will work there. The discussions here are now read-only.


JavaWorld Talkback >> 960462

JDBC user
Unregistered




Re: J2EE design decisions
      02/09/07 04:26 AM

The reasons that should convince me to abandon EJB+JDBC have many precondidions. Those pre-conds are not true in our organization. Let me clarify:

1. JDBC is tedious to write
No it isn't. Most of the code is in AbstractDAO class, including loading parameters to fetch the connection, fetching the connection and closing all the things that need to be closed. Every SQL stored procedure call from Java looks exactly same in the Java code and errors are very easy to spot there.

2. Increased development time
Maybe. I don't know where that increase comes from, since writing the DAO class (SQL procedure call) is very quick.

3. SQL is only as good as the developer who wrote it
Yes. And it actually is great. Our Java-developers don't write SQL. Database specialists write it and Java code simply calls procedures. Actually, everything else except calling stored procedures is strictly forbidden. Those same stored procedures are often called by several separate applications, even from different platforms.

In my opinion and our few year experience, this all seems to result in superior efficiency compared to using Hibernate or other O/R mapping tools. A few times some projects have tried Hibernate, Entity Beans and iBatis for example. The results have been a total catastrophe, according to both efficiency and maintainability of the code.

4. SQL code not portable
So what? Our database is the same as it's always been and the code will never be run outside of our organization. Secondly, by checking the actual code it can be seen that most of it actually does not use any vendor specific features, and is portable.

5. Increased maintenance and support
I don't get this. Who needs to be supported? In my opinion, JDBC is simpler to write than O/R mapping tools or AOP/POJO frameworks. And with JDBC, you dont need any cryptic configuration files. Simply switching on container-managed transactions for the EJB and telling the DAO which connection pool is to be used is the configuration you need to do.
I would say that JDBC with stored procedures leads to decreased maintenance instead. You can change the database and the stored procedures as long as the procedure interface doesnt change. The Java code need not be changed.

Post Extras Print Post   Remind Me!     Notify Moderator


Entire topic
Subject Posted by Posted on
* J2EE design decisions JavaWorld 01/27/06 04:20 PM
. * * Re: J2EE design decisions uttlylovely   08/01/08 12:09 AM
. * * Re: J2EE design decisions MacBlaster   01/31/06 04:14 PM
. * * Re: J2EE design decisions Anonymous   03/02/06 01:42 PM
. * * Re: J2EE design decisions    01/16/08 06:32 PM
. * * Re: J2EE design decisions Anonymous   05/30/06 01:14 PM
. * * Re: J2EE design decisions    06/27/07 05:53 PM
. * * Re: J2EE design decisions JDBC user   02/09/07 04:26 AM
. * * Re: J2EE design decisions    01/21/08 10:20 AM

Extra information
0 registered and 1 anonymous users are browsing this forum.

Moderator:   



Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Thread views: 14775

Rate this thread

Jump to

Contact us JavaWorld

Powered by UBB.threads™ 6.5.5