This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
Is there any point to using JDO or Hibernate for small web apps that may have only a few tables to deal with and perhaps 1/2 dozen queries? Or are these tools more or less show their stuff in the enterprise arena?
Depends really. I'd think more how likely said "small web app" was to be deployed with a different DB than that it was developed on. Once you get past the initial learning curve I'd say Hibernate was pretty much comparable with JDBC for complecity.
if you already know SQL/your object model is simple, then have a look at ibatis sql maps. Your SQL queries/inserts/updates are stored in xml files (that is nice if someone else than the java programmer writes the SQL or you want to change to another DB). This is an select statement in ibatis (taken from ibatis.com)
<select id="getAddress" parameterClass="int" resultClass="examples.domain.Address"> select ADR_ID as id, ADR_DESCRIPTION as description, ADR_STREET as street, ADR_CITY as city, ADR_PROVINCE as province, ADR_POSTAL_CODE as postalCode from ADDRESS where ADR_ID = #value# </select>
if you execute this statement, then you will get a prefilled examples.domain.Address object where ADR_ID is like the parameter you pass in. You are not restricted to pass only one paramter: you can also pass maps or beans.
i think it is a nice, thin layer above your database. perhaps a good fit if you do not need a full featured/complex system like hibernate.
Joined: Nov 12, 2004
Thanks for the heads up on Abatis, looks very good.