LibraryToggle FramesPrintFeedback

The org.springframework.jms.core.JmsTemplate class is a general-purpose class for managing Java Messaging Service (JMS) connections. One of the main advantages of this class is that it simplifies the JMS synchronous access codes.

To create an instance of a JmsTemplate, you need to supply a reference to a javax.jms.ConnectionFactory object.

The org.springframework.jdbc.core.JdbcTemplate class is a wrapper around a JDBC data source, enabling you to access a JDBC database using SQL operations.

To create an instance of a JdbcTemplate, you need to supply a reference to a javax.sql.DataSource object (for example, see JDBC Data Source).

[Note]Note

For a detailed discussion of the JdbcTemplate class, see Spring JDBC Template.

The org.springframework.jdbc.core.simple.SimpleJdbcTemplate class is a convenience wrapper around the JdbcTemplate class. This class has been pared down so that it includes only the most commonly used template methods and it has been optimized to exploit Java 5 features.

The org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate class is a convenience wrapper around the JdbcTemplate class, which enables you to use named parameters instead of the usual ? placeholders embedded in a SQL statement.

The org.springframework.orm.ibatis.SqlMapClientTemplate class is a simplifying wrapper around the iBATIS SqlMapClient class. iBATIS is an Object Relational Mapper (ORM) that is capable of automatically instantiating Java objects based on a given SQL database schema.

The org.springframework.orm.hibernate3.HibernateTemplate class provides an alternative to working with the raw Hibernate 3 session API (based on sessions returned from SessionFactory.getCurrentSession()).

[Note]Note

For Hibernate versions 3.0.1 or later, the Spring documentation recommends that you use the native Hibernate 3 API instead of the HibernateTemplate class, because transactional Hibernate access code can now be coded using the native Hibernate API.

The org.springframework.orm.jdo.JdoTemplate class provides an alternative to working with the raw JDO PersistenceManager API. The main difference between the APIs relates to their exception handling. See the Spring JavaDoc for details.

The org.springframework.orm.jpa.JpaTemplate class provides an alternative to working with the raw JPA EntityManager API..

[Note]Note

The Spring documentation now recommends that you use the native JPA programming interface instead of the JpaTemplate class. Considering that the JPA programming interface is itself a thin wrapper layer, there is little advantage to be had by adding another wrapper layer on top of it.

Comments powered by Disqus