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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
HikariCP is one of many decent JDBC connection pools available for Java and can be found at https://github.com/brettwooldridge/HikariCP.
- 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.
Worth mentioning: James Moore was a giant help in creating this section.
- 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.
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
Rights and permissions
Copyright information
© 2024 The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature
About this chapter
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
DOI: https://doi.org/10.1007/978-1-4842-9833-6_8
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-9832-9
Online ISBN: 978-1-4842-9833-6
eBook Packages: Professional and Applied ComputingApress Access BooksProfessional and Applied Computing (R0)