levo

Building a Desktop Solution with a Database

Data adaptors

  • 3 things to know
  • A2 Unit 2

Overview

Data adaptor and adaptor's role in a disconnected design.

What you need to know

Answer each one before you reveal it.

Your recallNot started
Key term

What does filling a data set actually do?

Key term

How does the adaptor know which rows to update when changes are sent back?

Key term

How are parameters supplied to an adaptor's select command?

Questions from this subtopic

Each one with the model answer underneath.

  1. 1

    What is a data adaptor?

    Model answer

    A data adaptor is the component that moves data between the database and an in-memory data set. It fills the data set from a query and sends the changes in the data set back to the database.

  2. 2

    What are the two directions a data adaptor works in?

    Model answer

    Filling, in which the adaptor runs a select command and loads the result into a data set; and updating, in which it examines the changes made in the data set and issues the insert, update and delete commands needed to apply them.

  3. 3

    Which commands does a data adaptor hold?

    Model answer

    A data adaptor holds a select command that fetches the rows, and insert, update and delete commands that apply changes. The three change commands can be generated from the select command or written by hand.

  4. 4

    Why might the change commands be written by hand rather than generated?

    Model answer

    Generated commands assume a simple single-table query with a primary key, so a query joining tables, using a view or applying a business rule needs commands written deliberately.

  5. 5

    What does filling a data set actually do?

    Model answer

    Filling opens the connection if it is closed, runs the select command, copies every returned row into a table inside the data set, and closes the connection again if the adaptor opened it.

  6. 6

    How does the adaptor know which rows to update when changes are sent back?

    Model answer

    Each row in the data set records its state — unchanged, added, modified or deleted — and the adaptor issues the corresponding command only for the rows whose state is not unchanged.

Other ways to work this

The same content, four other ways.

What is inside Levo

Six ways to work the same material.

1Closed book
2Open book
3Closed book

The 3-step method, run for you

Answer cold, learn it, then prove it stuck. Levo tracks the jump between your first attempt and your last.

Software and the Development Environment
Defining Data: Types, Variables and Classes
Program Control Structures
Objects, Classes and Data Structures

Cram a whole paper in one sitting

Sort every topic into what you know and what you do not, then drill only the weak ones.

A null is the of one.
absencepresencetype

Blank Blitz makes facts automatic

Rapid timed gap-fills on the terms and numbers you need to recall without thinking.

AA null means no value has been recorded.
BZero and an empty string are values.
CA null is the absence of a value.

Build It gets the exam shape right

Assemble a full-mark answer from its marking points, in the order an examiner wants them.

An error is the mistake a person made.
TrueFalse

Test It catches misconceptions

Spot the fault in a statement. The traps are the mistakes students actually make.

721941163128510

Brain Breaks between sessions

Short focus games to reset attention, so the next set lands better than the last.

Every question in Building a Desktop Solution with a Database, on a schedule.

Attempt a question from memory, write the correct version, then attempt it again. Levo records the jump between your first attempt and your last, and brings each question back on the day you are due to forget it.

Or £46 a year, about £3.83 a month. Cancel anytime.