Copyright © 2009-2012 ITTIA
| Voice: | 001-425 462 0046 |
| Fax: | 001-425 462 0048 |
| Email: | <info@ittia.com> |
| Website: | http://www.ittia.com |
Table of Contents
List of Figures
List of Tables
Table of Contents
ITTIA DB SQL™ is a next-generation transactional engine for development of dedicated embedded systems and mobile handheld devices. ITTIA DB SQL™ brings robust data management facilities to bear on the tough data management problems now faced by embedded developers, in a package that is lightweight, cross-platform, fast, and easy to use. With ITTIA DB SQL™, intelligent devices and embedded systems have access to full data management capabilities even when disconnected.
Table 1.1. SDK Folder Structure
Folder | Description |
|---|---|
win32 | ITTIA DB for the win32 platform |
win32/include/ | Header files for ITTIA DB |
win32/lib/ | ITTIA DB libraries |
win32/bin/ | Contains interactive SQL utility and lightweight data server |
win32/docs/ | User's guide and API reference manual |
win32/examples/ | Example telephone book application |
win32/dbcppapi/ | ITTIA DB C++ API sources |
csharp/ | ITTIA DB C# API for .NET applications |
csharp/lib/ | ITTIA DB C# assembly and companion native win32 library |
csharp/examples/ | C# examples for ITTIA DB |
java/ | ITTIA DB Java API and companion native win32 library |
java/doc/ | Java API documentation |
java/lib/ | ITTIA DB jar file |
java/src/com/ittia/example | Java examples for ITTIA DB |
ITTIA DB SQL™ includes an interactive SQL utility named ittiasql that can be accessed from the icon ITTIA SQL Utility. See the User's Guide for usage information. When run from the , databases are created in your Documents folder by default.
ITTIA DB SQL Plus™ includes a light-weight data server for shared access to database files. When an application is linked with the ittiaipc library, it will connect to the data server to open and create database files. You must run ITTIA DB Server from the to start the data server. See the User's Guide for usage information. When run from the , databases are created in your Documents folder by default.
The ITTIA DB kernel is a software library that can be directly embedded in an application, or accessed through a separate server processes. The database kernel provides a transactional C API that the application can use directly, or through ITTIA DB's C++ API bindings.
To minimize an application's code footprint and optimize performance, ITTIA DB SQL™ includes several alternative configurations of the ITTIA DB kernel that can be substituted for the default kernel library. These configurations omit specific features without changing the API interface. Available libraries are listed in Table 1.2, “ITTIA DB SQL™ Libraries”.
Table 1.2. ITTIA DB SQL™ Libraries
Configuration | Windows Library | Run-time DLL |
|---|---|---|
Default | ittiasql.lib | ittiasql.dll |
IPC client only | ittiasql_client.lib | ittiasql_client.dll |
Local storage only, with SQL | ittiasql_local.lib | ittiasql_local.dll |
Local storage only, without SQL | ittiadb_local.lib | ittiadb_local.dll |
Single-user local storage, with SQL | ittiasql_su.lib | ittiasql_su.dll |
Single-user local storage, without SQL | ittiadb_su.lib | ittiadb_su.dll |
Compact kernel | ittiadb_compact_su.lib | ittiadb_compact_su.dll |
The phonebook example is a console-based application that demonstrates how to store contact information in an ITTIA DB database.
ITTIA DB can be used in several different ways, and so to show this variety, there are four different implementations of the phonebook example. Developers may choose between the C API and the C++ API, which both offer access to the database through SQL queries, table cursors, or a combination of both.
Table 1.3. Phonebook example variations
Project | API | Database Access |
|---|---|---|
phonebook_cpp_sql | ITTIA DB C++ API | SQL queries |
phonebook_cpp | ITTIA DB C++ API | Table cursors |
phonebook_c_sql | ITTIA DB C API | SQL queries |
phonebook_c | ITTIA DB C API | Table cursors |
The C++ API examples depend on the project dbcppapi, which contains the source code for the ITTIA DB C++ API. Applications that use the ITTIA DB C++ API must include the C++ API source code in their build process.
When the phonebook example is run for the first time, a database file is automatically created and populated with a few sample entries. The same database file is shared between all implementations of the phonebook example.
ITTIA DB documentation consists of:
The essential guide to ITTIA DB usage and software development.
Reference manual for the ITTIA DB C API.
Reference manual for the ITTIA DB C++ API.
All documentation for ITTIA DB is available on-line at: http://www.ittia.com/products/documentation.
Table of Contents
To install the ITTIA DB SQL™ development kit on your computer, run ittiasql-*.exe and follow the instructions presented by the installer. Some components are optional and can be omitted from the installation.
To remove ITTIA DB SQL™ from your system, open → → . Select ITTIA DB SQL from the list, click the button, and answer when prompted.
If you have compiled any of the examples, the compiler output will remain in the examples folder and must be deleted manually. You may also need to remove any database and log files that have been created in your Documents folder.
Run the ITTIA SQL Utility from the Start Menu.
Create a new database file with the .create command. The database file is created in your Documents folder by default.
Create a table, insert a few rows, and select all rows in the table. For example:
create table hello_world (x integer, y nvarchar(20)); insert into hello_world values (1, 'Hello World'); insert into hello_world select n, 'Hello ' || cast(n as nvarchar) from $nat(3); select * from hello_world;
Save all changes to the database with the commit; SQL statement. If you do not commit your changes, they will be lost when you close the database.
Use the .exit command to close the database when you are finished.
Close all ITTIA SQL Utility windows. Start the ITTIA DB Server from the Start Menu. Database files will be located in the server's working directory, which defaults to your Documents folder.
To connect to the server, run the ITTIA SQL Utility from the Start Menu. Open the example database that you created in the previous section using the .open command and the x-dbtp:// protocol:
.open x-dbtp://localhost/example.db
In this way, you can open the same database file from multiple copies of the ITTIA SQL Utility and other ITTIA DB client applications. However, you cannot open the database file through the server if any program has the database file open directly.
To open the phonebook example in Visual Studio, select one of:
→ → →
→ → →
In Visual Studio, run the example with → .
By default, the examples are configured to create a local database file directly. Each example project has an IPC variation, identified by the _ipc suffix on the end of the project name. To share a database between multiple instances of the phone book example, run the ITTIA DB Server and one or more IPC example projects.