Online Eiffel Documentation
EiffelStudio

Inserter Sample

This sample lets the user insert a DB_BOOK object in your database using EiffelStore insertion facilities.

Compiling

To compile the example:

Running

This sample lets you interact with your database through a console.

First you have to enter the database connection information:

Then you can insert a book in the database, for instance:

What new book should I create?

Author? John Smith

Title? My book

Quantity? 1

Price? 50

Year? 2001

Double value? 12.675

Object inserted

Note: if your database does not contain a DB_BOOK table, this example will create it.

Under the Hood

This sample showcases the use of theDB_STORE class to perform database insertions where the SQL language is totally abstracted.

The whole sample code is contained in the root class: