Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.stack.nl!.POSTED!ipv6.urchin.earth.li!twic From: Tom Anderson Newsgroups: comp.lang.java.programmer Subject: Re: Spring/hibernate and JDBC Date: Sun, 10 Jul 2011 13:34:19 +0100 Organization: Stack Usenet News Service Lines: 50 Message-ID: References: <3c16e5e7-3c0b-4126-9dd9-88f372a58f03@e26g2000prf.googlegroups.com> NNTP-Posting-Host: ipv6.urchin.earth.li Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Trace: mud.stack.nl 1310301259 98753 2001:ba8:0:1b4::6 (10 Jul 2011 12:34:19 GMT) X-Complaints-To: abuse@stack.nl NNTP-Posting-Date: Sun, 10 Jul 2011 12:34:19 +0000 (UTC) User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) In-Reply-To: Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:6042 On Sat, 9 Jul 2011, markspace wrote: > On 7/9/2011 2:56 PM, Jack wrote: > >> With spring and hibernate so popular now, is there anybody still only >> use JDBC to write database application code? Thanks. > > I'm sure someone is, but yes I assume that JPA & Hibernate and > dependency injection frameworks like Spring and JSF have become the > norm. This has also been my impression. On my current project, we do still write raw SQL using JDBC on occasion, but only because we need to do some sort of mad query that can't be done with our persistence provider. For instance, we have a query that runs every hour to update our list of top-selling products, which joins together all sorts of tables and inserts the result directly into a table. I don't think there's any way to do that (up to and including inserting from the select) with JPA. Now, having said that, it appears that somebody doesn't see raw JDBC as being limited to corner cases, because they've steadily been adding features to it. Features i find quite baffling. Here's what's coming in JDK 7 (skip over the try-with-resources stuff, which is great, but not baffling): http://download.java.net/jdk7/docs/technotes/guides/jdbc/jdbc_41.html Who is the target market for this RowSetFactory stuff? In fact, who is the target market for the existing RowSets? We have CachedRowSet, FilteredRowSet, JoinRowSet, JdbcRowSet (!), and WebRowSet - none of which i have ever seen used or advocated. Who is using these, and what for? The javadoc for JdbcRowSet says: A wrapper around a ResultSet object that makes it possible to use the result set as a JavaBeansTM component. Thus, a JdbcRowSet object can be one of the Beans that a tool makes available for composing an application. Waitwhat? Tools composing applications out of JavaBeans? Wasn't that idea dead in, like, 1998? What the hell is going on here? Is there some mad backwater Lost World of Java development where people are actually building apps by dragging icons around in tools? tom -- Everyone has to die sooner or later, whether they be killed by germs, crushed by a collapsing house, or blown to smithereens by an atom bomb. -- Mao Zedong