mahendran.mookkiah a1a4088087 As getAll method returns a Stream, we cannot close the involved
resources (Connection, Statement and resultSet) until the stream is
closed by the consumer. So try-with-resources is not an option as per
sonarqube’s recommendation. But it is still recommended to close
statement and result set. When connection pool used, connection is not
closed when close() called. It is just returned to the pool.

Using //NOSONAR to avoid false blocker issue.
2017-08-13 10:19:48 -04:00
..
2017-02-11 21:46:56 +02:00

layout, title, folder, permalink, pumlid, categories, tags
layout title folder permalink pumlid categories tags
pattern Data Access Object dao /patterns/dao/ 5SR14OKW30N0LhG0oVrt4o6ZE12Ov4NR_thQNQlc5aN2sd82qtz4naywAixOmyNoK8WYvT6fjdWOR7JnpLiHhuTkam4nTUhiRwZm847-J64zpUZj3m00 Persistence Tier
Java
Difficulty-Beginner

Intent

Object provides an abstract interface to some type of database or other persistence mechanism.

alt text

Applicability

Use the Data Access Object in any of the following situations

  • when you want to consolidate how the data layer is accessed
  • when you want to avoid writing multiple data retrieval/persistence layers

Credits