Skip to main content

2017 | OriginalPaper | Buchkapitel

5. Data Access

verfasst von : Iuliana Cosmina

Erschienen in: Pivotal Certified Professional Spring Developer Exam

Verlag: Apress

Aktivieren Sie unsere intelligente Suche, um passende Fachinhalte oder Patente zu finden.

search-config
loading …

Abstract

Software applications usually handle sets of data that must to be stored in an organized manner so they can be easily accessed, managed, and updated. The fact that data can be made to persist means that is can be available even when the application is down. So storage is decoupled from the rest of the application. The most common way of organizing data for storage is a database. Any storage setup that allows for data to be organized in such a way that can be queried and updated represents a database.

Sie haben noch keine Lizenz? Dann Informieren Sie sich jetzt über unsere Produkte:

Springer Professional "Wirtschaft+Technik"

Online-Abonnement

Mit Springer Professional "Wirtschaft+Technik" erhalten Sie Zugriff auf:

  • über 102.000 Bücher
  • über 537 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Maschinenbau + Werkstoffe
  • Versicherung + Risiko

Jetzt Wissensvorsprung sichern!

Springer Professional "Technik"

Online-Abonnement

Mit Springer Professional "Technik" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 390 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Maschinenbau + Werkstoffe




 

Jetzt Wissensvorsprung sichern!

Springer Professional "Wirtschaft"

Online-Abonnement

Mit Springer Professional "Wirtschaft" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 340 Zeitschriften

aus folgenden Fachgebieten:

  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Versicherung + Risiko




Jetzt Wissensvorsprung sichern!

Fußnoten
1
My Batis was previously knows as iBatis, before Apache dropped it. More information on the new official site: http://blog.mybatis.org/
 
3
Other Spring classes to access a different type of resource follow the same pattern: JmsTemplate, RestTemplate, etc.
 
4
Polymorphism is one of the object oriented programming principles. The term is of Greek etymology and means one name, many forms. Polymorphism manifests itself in software by having multiple methods all with the same name but slightly different functionalities.
 
5
This approach of providing parameters is used by JPA and Hibernate as well.
 
6
Code accessible on GitHub: https://github.com/spring-projects/spring-framework/blob/master/spring-jdbc/src/main/java/org/springframework/jdbc/core/namedparam/NamedParameterJdbcTemplate.java , or in Intellij IDEA, click on the class name and press the Control (Command on MacOs) key, and the sources will be opened for you.
 
7
Its many signatures and recommended uses can be inspected in the official JavaDoc available online http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/jdbc/core/JdbcTemplate.html .
 
8
This kind of approach leaves an application sensitive to SQL Injection attacks, which is why in enterprise applications, the tables are never created by executing DDL scripts in the code with parameter values provided by the user.
 
9
Class org.springframework.dao.DataAccessException is an abstract class, parent of all the family of Spring Data Access exceptions.
 
10
An exception to this rule would be if the server catches fire or gets really wet.
 
11
You can find more about Atomikos from their official site https://www.atomikos.com/ .
 
12
The most popular programmers’ social network http://stackoverflow.com
 
13
The most popular article about Spring distributed transactions has since 2009 been David Sayer’s http://www.javaworld.com/article/2077963/open-source-tools/distributed-transactions-in-spring–with-and-without-xa.html .
 
14
A complete list of steps showing how to configure and use the Atomikos JTA provider is available on the Spring official blog: https://spring.io/blog/2011/08/15/configuring-spring-and-jta-without-full-java-ee/ .
 
15
Hibernate OGM provides Java Persistence (JPA) support for NoSQL solutions. It reuses Hibernate ORM?s engine but persists entities into a NoSQL datastore instead of a relational database. Read more about it on the official site: http://hibernate.org/ogm/ .
 
16
You can read more about the project on their GitHub page https://github.com/brettwooldridge/HikariCP .
 
17
The EntityManager instance annotated with @PersistenceContext cannot be accessed from a constructor, since it cannot be created and associated with the persistence context in the constructor. The reason for this is the definition of the @PersistenceContext. This annotation has the following meta-annotation defined: @Target(value=TYPE,METHOD,FIELD). Full JavaDoc API here: http://docs.oracle.com/javaee/7/api/javax/persistence/PersistenceContext.html .
 
19
You can read about them here: http://nosql-database.org/ .
 
Metadaten
Titel
Data Access
verfasst von
Iuliana Cosmina
Copyright-Jahr
2017
Verlag
Apress
DOI
https://doi.org/10.1007/978-1-4842-0811-3_5