Spring Data Access with JdbcTemplate

  • Chapter
  • First Online:
Beginning Spring 6

Abstract

It’s time we started looking at how we actually access data. Spring has multiple ways of accessing data; here, we’re going to look at JdbcTemplate, a facade that provides trivial access to common operations, and we’re going to address some of Chapter 7’s other issues with data access.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
EUR 32.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or Ebook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 44.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 59.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free ship** worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    HikariCP is one of many decent JDBC connection pools available for Java and can be found at https://github.com/brettwooldridge/HikariCP.

  2. 2.

    Just in case you’re interested, “a,” “an,” and “the” are in fact all of the articles in English. “A” and “an” are called “indefinite articles,” because they refer to one of a set of objects without specifying which one of the set is being referred to, while “the” is called a “definite article” because it’s specifying a particular object.

  3. 3.

    Worth mentioning: James Moore was a giant help in creating this section.

  4. 4.

    Cyclomatic complexity is, well, way out of scope for this book, but now that we’ve mentioned it: it’s a way of calculating the number of independent paths through a method, by looking at the control flow. Basically, every nested difference in control flow adds to the complexity of a method. The streamed version of findArtistByName(String, boolean) looks complex because it’s got some nested method calls and it’s a less familiar set of operations for many programmers, but it’s actually simpler because there are fewer branches in the code, thus it gets a lower real complexity score. With that said, the goal of programming is to get something done, as opposed to a mandate to use streams or whatever - so you should feel free to do what makes sense to you and what you are able to make work.

  5. 5.

    This chapter will finish what we started in Chapter 7. Our prior chapter added a web interface for parts of a music service, but didn’t include all of our requirements because it wasn’t the right place to bring up transactions. After this section, you could write a rich client to interact with the services and have a functioning application.

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2024 The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Ottinger, J.B., Lombardi, A. (2024). Spring Data Access with JdbcTemplate. In: Beginning Spring 6. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-9833-6_8

Download citation

Publish with us

Policies and ethics

Navigation