Questions tagged [dao]

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

2621 questions
0
votes
1 answer

How to insert selected result from a table into another table on Android Room's DAO class

I've been developing a budget spending tracking app on Android Studio. In this particular part, what I want to do is to insert the selected result of a table "budget_tracker_table" into another table "budget_tracker_table_alias". The SQL I coded…
user10040408
0
votes
1 answer

When I work with JAVA dao architect I had a problem when I had a foreign key

I had a java project about bank account managing with java ana DAO Design. I work in operation class witch is depend to client class and account(compte in french ) class. operation variable class is like that: private String DateDebut ; private…
Ben Hmida
  • 33
  • 5
0
votes
2 answers

DAO recordset with substring function

i have a vb6 application that i am using DAO to create a connection to a database and trying to open a recordset. the database is a foxpro database and i have refernece to Microsoft DAO 2.5/3.5 Compatibility Library. my code is as follows Dim…
0
votes
1 answer

Change Recordset Type via VBA

I have a MS-Access database, which includes several queries, which have the recordset type Dynaset. I want to change all Queries to the Recordset Type Snapshot (i.e. dbOpenSnapshot). Following approach gives me the error message that dbOpenSnapshot…
0
votes
0 answers

Receiving Intermittent MS Access Error 2467 when Updating Records via Code

I have an MS Access db split FE/BE on a network file share, that holds employee "Roster" info - Name, Division, Unit, Work location etc. I recently added a simpler feature for updating "DivisionUnit" than what existed previously. I also added code…
JuniperSquared
  • 143
  • 1
  • 12
0
votes
1 answer

CS0120 errorcode c#

I'm trying to add some data to the database using an sql query in c#, but I got this error code in my service class, it says: "An object reference is required for the non-static field, method, or property 'SupervisorDao.AddSupervisor(supervisor)'. I…
Jan
  • 11
  • 3
0
votes
1 answer

SQL statement in Java DAO method is not checking if user exists properly

I have DAO method in Java which looks like this: private boolean validateUser(String email, String username) throws SQLException { return stmt.execute( "SELECT NOT EXISTS" + "(SELECT id from Math_Hub.Users_Information " + …
0
votes
1 answer

In ORMLite why should we use DAOs with an ID of a specific type when Object seems to work?

I can extend BaseDaoImpl using either Dao or Dao, for instance. Why would I specify UUID when Object seems to work just as well? Using Object in all of my Dao implementations in a large-ish project have been…
Sean Anderson
  • 614
  • 8
  • 20
0
votes
1 answer

Saving and retrieving attachments to a shared Access db, attachment not found for other users

I have an Excel macro that CRUDs work orders to which the user also attaches an image. Everything gets saved to an Access db on a SharePoint folder. For example, a work order for department A gets created, and to the record we attach a picture to an…
sabukaru
  • 5
  • 4
0
votes
1 answer

Spring JPATemplate DAO. DELETE Items from table

News @Entity @Table(name = "NEWS") @NamedQueries({ @NamedQuery(name = "News.findAll", query = "SELECT n FROM News n"), @NamedQuery(name = "News.delete", query = "DELETE FROM News n WHERE n.newsId in(:ids)") }) @GenericGenerator(name =…
Ivan
  • 3
  • 4
0
votes
2 answers

JPA + SPRING=DAO. Dynamic Parameter List

I can't resolve error with dynamic parameter list "where in". Another query working @NamedQuery(name = "News.delete", query = "DELETE n FROM News n WHERE n.newsId in (:ids)") but Caused by: java.lang.NoSuchMethodError:…
Ivan
  • 3
  • 4
0
votes
1 answer

How to fill LiveData with custom List rather than All Objects?

I am having some issues with Room, and I am a little lost on the proper way to do this. I am trying to create a RecyclerView that shows all of the Courses that hold a certain termId. When calling the query in the Activity, it gives me an…
0
votes
1 answer

Not sure how to handle insert method's return type. public abstract java.lang.Object insert(@org.jetbrains.annotations.NotNull()

I am complete new to kotlin, and trying to build a notes app using MVVM architecture. But somewhere I go wrong and end up with this error. My kotlin version is 1.5.31 NoteDao.java:11: error: Not sure how to handle insert method's return type. …
Ayush Tiwari
  • 91
  • 1
  • 8
0
votes
1 answer

DAO design pattern: where should the database access be implemented?

I am building a Java application that uses a database and I'm using a DAO design pattern: in my code, all objects classes have an associated DAO class that implements an interface with get, save and update methods. For instance, for a User object, I…
rubytox
  • 87
  • 8
0
votes
1 answer

Query to String from Room Database

How do I create a query to my room database from example the SUM of a database column then convert it to a String to then populate text fields in a different activity? I have 5 activities in my app where I wish to customise the data that is…