Questions tagged [data-access-object]

A Data Access Object (DAO), is a design pattern in object-oriented software design, creating an object that provides an abstract interface to some type of database or other persistence mechanism.

A data access object (DAO) is an object that provides an abstract interface to some type of database or persistence mechanism, providing some specific operations without exposing details of the database. It provides a mapping from application calls to the persistence layer.

Source: Wikipedia (retrieved version)

More details: - Core J2EE Patterns - Data Access Object

31 questions
63
votes
2 answers

What is the difference between DAO and DAL?

Having studied Java at school I am quite familiar with the DAO-pattern(Data access object). However at work I use .NET. In .NET there is often talk about the DAL(Data Access Layer). To me their purpose seems quite similar. So the question is are DAO…
simoraman
  • 919
  • 1
  • 8
  • 13
9
votes
2 answers

Should DAO's validate the input

since DAO layer is typically responsible for accessing data from DB given certain input (like a user_id etc), should it concern itself with checking the validity of its input? E.g. if there's a DAO method to fetch a user based on user_uid, which is…
shrini1000
  • 7,038
  • 12
  • 59
  • 99
6
votes
2 answers

Data access object (DAO) in Python Flask SQLAlchemy

Does the Python (Flask) SQL Alchemy uses both DAO and ORM design, or simply just ORM? I am learning design strategies and I thought of SQLAlchemy. Is it considered a DAO (clearly ORM) as well? By default, it does not look like DAO. What if I defined…
5
votes
4 answers

DAO error:-Type of the parameter must be a class annotated with @Entity or a collection/array of it

I am new to android development and I am trying to make a notes app by following the android architecture components but on running I am getting errors in my DAO if any one could help would be highly grateful. Here's the code and the error that I am…
4
votes
1 answer

Implementing network calls in dao class

Dao is an object or interface that provides access to the database or other kinds of storage. So if we write network call in dao interface, is it still be ok or should we write another network call files to implement methods to do actions (such as…
MinnKhant
  • 61
  • 8
2
votes
2 answers

I can't get the DAO/DTO pattern with SQLite in java

I've been trying to understand the DAO pattern but now I have not been successful . Probably because I have not been able to apply what I've found on the internet to problem I try solve. I want to encapsulate the database, do the things right. I did…
exsnake
  • 1,767
  • 2
  • 23
  • 44
1
vote
1 answer

Applying changes of ToMany relation to objectbox store in dart

In project i use latest Dart version with objectbox: ^1.0.0: @Entity class Node{ ... @Transient() final List _edges = List.empty(growable: true); final relEdges = ToMany(); ... } @Entity class Edge{ ... …
1
vote
1 answer

Interaction between WCF, DAO and DTO layers in ASP.NET application

Can someone guide me in how the WCF, DAO and DTO layers communicate with each other? I would appreciate if someone can specify which layer comes first and then how it interacts with the next layer and so on.
Huzefa Kagdi
  • 159
  • 1
  • 4
  • 11
1
vote
2 answers

What's the difference between DAO and DP patterns?

What is the difference between Data Access Objects (DAO) and Data provider (DP) patterns? I've read about them and it seems to me that they're the same except that .NET uses the data provider terminology.
Zaxter
  • 2,939
  • 3
  • 31
  • 48
1
vote
1 answer

Using VBA-Excel for an SQL query across multiple databases

Using Excel 2010, SQL and DAO I am trying to execute a query against tables which reside outside the current spreadsheet. This would be trivial, inside Access, with linked tables/databases, but using VBA in excel, I am stymied. Presuming…
John
  • 207
  • 3
  • 12
1
vote
2 answers

Testing Data Access Objects

When testing a DAO i follow these rules: Use an in-memory database Reset database data for every test This works well for selecting from the database. I setup the database with the data needed for the select, call my DAO and verify, that the…
Luca Fülbier
  • 2,641
  • 1
  • 26
  • 43
1
vote
3 answers

Access 2007 DAO VBA Error 3381 causes objects in calling methods to "break"

---AFTER FURTHER INVESTIGATION--- "tblABC" in the below example must be a linked table (to another Access database). If "tblABC" is in the same database as the code then the problem does not occur. Hi, We have recently upgraded to Office 2007. We…
MT.
  • 791
  • 5
  • 15
  • 23
0
votes
2 answers

Implementing Dao Crashes the App (Kotlin)

I've been following an Android App Development tutorial on Udemy and was working on getting the room database working. Link to the GitHub: https://github.com/tutorialseu/RoomDatabaseDemo/tree/169_completing_the_demo For some reason, the following…
Yun
  • 37
  • 1
  • 1
  • 8
0
votes
0 answers

Insert module in python

I have few tables in my ETL projects that are being loaded very frequently. I want to create a common module where all main modules can just call this common module, pass column values and insert data. In c#, to achieve this, we have properties…
0
votes
0 answers

Database File 'is being used by another process' when all connections are closed

I am developing a system which uses a database access object (DAO) to link between the program and database. All connections must be made through this class, using getConnection(). However, I have a reset option which overrides the database file in…
Kerage Chan
  • 116
  • 1
  • 9
1
2 3