You are previewing Just Spring Data Access.
O'Reilly logo
Just Spring Data Access

Book Description

JDBC has simplified database access in Java applications, but a few nagging wrinkles remain—namely, persisting Java objects to relational databases. With this book, you’ll learn how the Spring Framework makes that job incredibly easy with dependency injection, template classes, and object-relational-mapping (ORM). Discover how Spring streamlines the use of JDBC and ORM tools such as Hibernate, the Java Persistence API (JPA), and Java Data Objects (JDO).

Table of Contents

  1. Just Spring Data Access
  2. SPECIAL OFFER: Upgrade this ebook with O’Reilly
  3. Foreword
  4. Preface
    1. Conventions Used in This Book
    2. Using Code Examples
    3. Safari® Books Online
    4. How to Contact Us
    5. Acknowledgments
  5. 1. Basics
    1. Using Plain JDBC
    2. Spring Data Access
    3. Templates
      1. MySQL Database Scripts
      2. Using JdbcTemplate
        1. Configuring a DataSource
        2. Configuring JdbcTemplate
        3. Working with JdbcTemplate
          1. Querying for Single and Multiple Rows
          2. Bind Variables
          3. Mapping Rows to Domain Objects
          4. Fetching List of Trades
        4. Inserting, Deleting, and Updating Rows
        5. Executing Statements
    4. Summary
  6. 2. Advanced Concepts
    1. NamedParameterJdbcTemplate
      1. Using Map
      2. Using SqlParameterSource
    2. Jdbc Batching
      1. Using SqlParameterSourceUtils
      2. Using BatchPreparedStatementSetter
    3. Simple JDBC Classes
      1. SimpleJDBCInsert Class
      2. SimpleJdbcCall Class
    4. In-Memory Databases
    5. Callbacks
      1. PreparedStatement Callback
      2. Callable Statement Callbacks
      3. Row Callbacks
    6. Summary
  7. 3. Hibernate
    1. Two-Minute Hibernate
    2. Using Spring Hibernate
      1. Basic Setup
      2. Hibernate Operations
        1. Finding a Single Row
        2. Finding Multiple Rows
        3. Deleting Single Trade
        4. Deleting Multiple Trades
        5. Spring’s Job Is Done
      3. Using HibernateTemplate
        1. Hibernate Support Classes
    3. Transactions
    4. Summary
  8. 4. Spring JPA
    1. Two-Minute JPA
    2. Using Spring
      1. Standalone Factory
      2. Container Factory
        1. Configuring the Factory
      3. Transactions
      4. Using Plain JPA API
      5. Using JpaTemplate
    3. Support Classes
    4. Summary
  9. 5. Spring JDO
    1. Spring Support
    2. Plain JDO API
      1. Persistent Entity
      2. Persistence DAO
      3. Wiring the Pieces
      4. Bytecode Enhancers
      5. Example Test
    3. Working with JdoTemplate
    4. Support Classes
    5. JDO versus JPA versus Hibernate
    6. Summary
  10. About the Author
  11. SPECIAL OFFER: Upgrade this ebook with O’Reilly
  12. Copyright