Using DBMS LINTER on Android OS Platform

RELATIONAL DATABASE MANAGEMENT SYSTEM Linter Standard Linter Bastion Linter RealTime Linter Multiversion Using DBMS LINTER on Android OS Platform R...
2 downloads 0 Views 1MB Size
RELATIONAL DATABASE MANAGEMENT SYSTEM

Linter Standard Linter Bastion Linter RealTime Linter Multiversion

Using DBMS LINTER on Android OS Platform

RELATIONAL EXPERT SYSTEMS RESEARCH AND PRODUCTION ENTERPRISE

Trademarks RELEX™, LINTER®, NEVOD®, LAB™, LAKUNA are trademarks of «Relational Expert Systems, Ltd.» (hereafter, "RELEX"). Other names and brandings are trademarks of their manufacturers, sellers or developers. Intellectual Property All rights to LINTER®, NEVOD®, LAB™, and LAKUNA belong to RELEX (1990–2015). All rights reserved. This particular document is property of RELEX. No part of this document can be reproduced, transmitted, reformed, saved in an information search system, translated to another language or computer language in any form, by any electronic, mechanic, magnetic, optical, chemical, manual or other means without prior permission of RELEX. About the Document The material of this document has gone through cautious examination, but RELEX does not guarantee that the document contains no errors or omissions. RELEX reserves the right to bring in corrections and alterations, to reconsider and update contained information at any moment. Address Office: 119 20-letiya Oktyabrya St., Voronezh, 394006, Russia Phone / Fax: +7 (473) 2-711-711, 2-778-333 e-mail: [email protected]. Technical Support Software product support and maintenance division: Phone:+7 (473) 2-711–711 from 9:00 to 18:00 MSK (UTC+3). e-mail: [email protected], [email protected]. To improve the quality of developed software and delivered services, RELEX provides an automated system of filing and processing the reclamations. We request that you report us on any detected defects and errors in software products and/or documentations on our Internet website reclamation.

Table of Contents Document Purpose................................................................................................................................1 Required Knowledge.............................................................................................................................1 Accepted Designations and Conventions.............................................................................................1 Additional Documents ...........................................................................................................................2 DBMS LINTER Installation Variants............................................................................................. 3 Installation from the Host Computer .....................................................................................................3 Installation by Using a MicroSD Card ...................................................................................................7 Installation from the RELEX Company Website...................................................................................7 Creating and Configuring a Database ......................................................................................... 9 Creating a Database .............................................................................................................................9 Creating the System Tables................................................................................................................12 Configuring a Database.......................................................................................................................13 DBMS Performance Management.............................................................................................. 15 Setting the DBMS Launch Parameters...............................................................................................15 DBMS Launch .....................................................................................................................................16 DBMS Shutdown .................................................................................................................................17 DBMS Restart......................................................................................................................................18 DBMS Tools ................................................................................................................................. 19 Command Interface.............................................................................................................................19 User SQL Script Collection .................................................................................................................20 Initializing the Work with the SQL Script Collection............................................................................ 20 Adding An SQL Script to the Collection .............................................................................................. 21 Viewing the SQL Script Text ............................................................................................................... 22 Executing an SQL Script from the Collection ..................................................................................... 23 Deleting an SQL Script from the Collection ........................................................................................ 23 Editing the SQL Script Infromation...................................................................................................... 24 Speed Characteristic Test...................................................................................................................24 Backup Copying ..................................................................................................................................25 LINTER Desktop .................................................................................................................................27 Interfaces of Client Applications Interacting with DBMS LINTER .......................................... 29 JAVA Applications ...............................................................................................................................29 С/С++ Applications..............................................................................................................................31 JDBC Interface ....................................................................................................................................31 Network Access to the DBMS .................................................................................................... 32

I

Using DBMS LINTER on Android OS Platform

Table of Contents Diagnostic Messages .................................................................................................................. 33

II

Using DBMS LINTER on Android OS Platform

Introduction Document Purpose This document contains the description of using DBMS LINTER in the Android OS environment and is intended for DBMS LINTER administrators and programmers developing Android applications that interact with databases. The document may be used for operating any version of DBMS LINTER. Specific features of particular versions are described further in the text.

Required Knowledge Using DBMS LINTER on the Android OS platform requires: 

knowing the basics of relational databases;



ability to work with Android OS on the common user level.

Accepted Designations and Conventions Designation Italic type

Example Raster is an image data…

Definition A new term in the text

Boldface type

In this case it is necessary to move all physical files. For more information about application performance see www.linter.ru. Execute the command

Highlighting in the text

Text enclosed in < > with + between them Large monospaced text Small monospaced text

+

Keyboard keys are enclosed into< >, the + symbol means key combination Command line text

Page Time Count

Program text

Capital letters

BROWSE

Italics type in < >

< return statement>

Command names, words reserved in SQL, key words Specified element of a semantic phrase

Underlined type Text divided with 

View  Properties

SQL> _q

::= Character

Square brackets [ ]

DBSTORE [-d –n –o –p – r –t –u]

Vertical line |

::= | NULL

1

Internet website address

Command execution sequence

Equality by definition. The defined notion stands to the left of the symbol, the concept definition itself stands to the right Optional phrase elements. In this particular example the keys are nonobligatory command elements Specifies that all previous elements of the list are optional and can be replaced with any other element of the list after this line

Using DBMS LINTER on Android OS Platform

Introduction Designation Curved brackets { }

Elision marks «…»

Example CODEPAGE {866 | 1251 | KOI8} Column characteristics MAKE CHAR(20) MODEL CHAR(20) ... SQL>

Elision marks with a comma inside «.,..»

Text with  against gray background



If the page layout configuration ignores the properties, the command will be executed inappropriately.

Definition Specifies that all elements inside are a single whole

Specifies that the previous part can be repeated any number of times

Specifies that the previous operator part that consists of several elements divided by commas can be repeated a random number of times Note

Additional Documents

2



DBMS LINTER. Command Interface.



DBMS LINTER. Creating and Configuring a Database.



DBMS LINTER. Archiving and Restoring a Database.



DBMS LINTER. Speed Performance Test.



DBMS LINTER. LINTER Desktop.



DBMS LINTER. Network Facilities.

Using DBMS LINTER on Android OS Platform

DBMS LINTER Installation Variants The possible ways of installing DBMS LINTER are: 

from the host computer;



from a MicroSD card device;



from the RELEX company website.

The DBMS LINTER distribution kit for Android OS is the Linter-release.apk file.

Installation from the Host Computer Installing DBMS LINTER from the host computer requires the following resources: 

a host computer with installed Win32, Linux or Mac OS X operating system and Android SDK containing the adb.exe (Android Debug Bridge) utility;



a device (such as tablet computer, smartphone etc.) with installed Android OS for installing DBMS LINTER;



DBMS LINTER distribution kit (deliverable disc) for Android OS;



70 Mbytes of free built-in memory on the Android OS device for placing the DBMS LINTER components and 10 Mbytes for the Ministro Android application (required for some DBMS LINTER components to function);



free disc space on the Android OS device for placing the user database (the free memory size depends on the intended number of database objects and the type of information they will contain);

DBMS LINTER is installed to the OS Android device by using Android Debug Bridge (adb.exe for Win32 type OS or adb for Linux OS) from the Android SDK package. For Win32 type OS the adb.exe utility is located in the \platform-tools\ directory of the host computer, and for Linux OS the adb utility is located in the /platformtools/ directory of the host computer where is the Android SDK installation directory.

 Download and installation from the Google Play application store is currently unavailable. To install DBMS Linter: 1) copy the Linter-release.apk file from the DBMS LINTER distribution kit (deliverable disc) to the host computer work directory; 2) connect the Android OS device to the host computer via the USB port; 3) open the command interface and execute the following command on the host computer: \platform-tools\adb install \Linter-release.apk (for Win32 type OS)

or OS)

/platform-tools/adb install /Linter-release.apk (for Linux

where: is the specification of the Android SDK package installation directory path; is the specification of the Linter-release.apk file work directory path on the

host computer.



Download and installation from the Google Play application store is currently unavailable.

Using DBMS LINTER on Android OS Platform

3

DBMS LINTER Installation Variants

If DBMS LINTER installation is successful, the following message will be output onto the host computer console: 1388 KB/s (19311270 bytes in 13.586s) pkg: /data/local/tmp/Linter-release.apk Success

 The speed, size and duration values may differ from those specified above. The RDBMS Linter SQL (“DBMS LINTER”) menu option will be added to the main menu of the Android OS device (Fig. Fig. 1).

The added menu option

4

Using DBMS LINTER on Android OS Platform

DBMS LINTER Installation Variants Fig. 1. The Android OS Device Main Menu

The /data/data/com.relex.linter/ directory the structure of which is shown in Fig. 1 will be created on the Android OS device during the DBMS LINTER installation.

Fig. 1. DBMS LINTER Installation Directory Structure The installation directory structure and components are described in Table 1.

Using DBMS LINTER on Android OS Platform

5

DBMS LINTER Installation Variants Table 1. DBMS LINTER Installation Directory Structure and Component Description Subdirectory File Description /db

Database default directory

/files/bin

lindesk utility resource file directory

/files/call

Header files required for developing client applications based on the Call Interface

/files/db

Directory containing SQL scripts for creating and filling the demo database

/files/dict

SQL scripts for creating database system tables

./lib

Libraries and executable files libchklinter.so Utility for checking the kernel process existence (workability) libdbc_tcp.so

Client network driver

libdbs_tcp.so

Server network driver

libgendb.so

Database creation and tuning utility

libinl.so

DBMS LINTER command interface

libintlib.so

Call Interface library

libintsrt.so

Sorting processor (called by DBMS LINTER kernel)

liblhb.so

Database archiving and restoring utility

liblinapid.so

JDBC server

liblindesk.so

«LINTER Desktop» utility

liblinter.so

DBMS LINTER kernel

libshut.so

DBMS LINTER kernel shutdown utility

libsql.so

SQL operator translator (called by DBMS LINTER kernel)

libtpcb.so

DBMS LINTER kernel speed characteristic test

libtsp.so

Procedural language translator (called by DBMS LINTER kernel)

libutil.so

LINTER service library of the Android application

/shared.prefs

Android application directory for storing the LINTER service data test.txt

6

Original text of the test example

Using DBMS LINTER on Android OS Platform

DBMS LINTER Installation Variants

Installation by Using a MicroSD Card Installing DBMS LINTER from a MicroSD card device requires the following resources: a resource with the Linter-release.apk DBMS LINTER distribution kit file for Android OS (on the host computer, website or MicroSD card);

 

a MicroSD card connection slot on the Android OS device;



at least 20 Mbytes of free space on the MicroSD card;

 an Android OS application functioning as a file manager (for example, “ES File Explorer”).

DBMS LINTER installation requires: 1) inserting the MicroSD card into the MicroSD card connection slot; 2) creating a DBMS LINTER installation directory (if needed) using the Android OS file manager if there is no DBMS LINTER distribution kit file on the MicroSD card. If the installation directory is not created, the DBMS LINTER distribution kit file will be copied from the external source to the MicroSD card root directory by default; 3) downloading the Linter-release.apk DBMS LINTER distribution kit file to the MicroSD card from an external source (host computer, website) if it does not contain one; 4) proceeding to the MicroSD card directory containing the downloaded DBMS LINTER distribution kit file by using the Android OS file manager; 5) touching the element representing the LINTER application. As a result, the user will be offered to install the application; 6) installing the LINTER application using the standard Android OS application installation procedure. If the installation is successful, The RDBMS Linter SQL (“DBMS LINTER”) menu option will be added to the main menu of the Android OS device (Fig. Fig. 1), and the /data/data/com.relex.linter/ directory the structure of which is shown in Fig. 1 will be created in the Android OS device built-in memory.

Installation from the RELEX Company Website Installing DBMS LINTER from the RELEX Company website (www.linter.ru) requires Internet connection between the RELEX website and Android OS device.



The user must be registered on the www.linter.ru website. To install DBMS LINTER: 1) launch the application functioning as a browser on the Android OS device; 2) download the DBMS LINTER distribution kit file for Android OS using the following link: download; 3) if some files have been previously downloaded from the Internet to the Android OS device, the list of them will be output onto the screen. Select the element representing the DBMS LINTER distribution kit apk-file from the downloaded file list of the browser. As a result, the user will be offered to install the Android LINTER application; 4) install the LINTER application using the standard Android OS application installation procedure. If the installation is successful, The RDBMS Linter SQL (“DBMS LINTER”) menu option will be added to the main menu of the Android OS device (Fig. Fig. 1), and the

Using DBMS LINTER on Android OS Platform

7

DBMS LINTER Installation Variants /data/data/com.relex.linter/ directory the structure of which is shown in Fig. 1 will be created in the Android OS device built-in memory.

8

Using DBMS LINTER on Android OS Platform

Creating and Configuring a Database As opposed to other software platforms, in the Android OS environment a demo database is not created during the DBMS LINTER installation, therefore users cannot use it as a practice or work database. Users must create one or more databases they need on their own. Database creation implies executing the following operations: 1) creating the database system and work files using the gendb DBMS LINTER utility (mandatory); 2) creating the database system tables using the special Android OS application (mandatory); 3) configuring the database (configuring the database parameters in accordance with the specific requirements of client applications) (optional).

Creating a Database A database is created on behalf of the SYSTEM/MANAGER user. To create a database: 1) select the RDBMS Linter SQL menu option from the main menu of the Android OS device (Fig. Fig. 1) to activate the DBMS LINTER operating menu (Fig. 2);

Fig. 2. DBMS LINTER Operating Menu 2) press the Tools button in the DBMS LINTER operating menu to activate the window with the list of available tools (Fig. 3);

9

Using DBMS LINTER on Android OS Platform

Creating and Configuring a Database

Fig. 3. DBMS LINTER Tools 3) select the GenDB option from the available tool window to activate the database creation window (Fig. 4);

10

Using DBMS LINTER on Android OS Platform

Creating and Configuring a Database

Fig. 4. Database Creation Window 4) specify the location of the created database. To do this:  enter the following gendb utility command in the type commands or enter DB name input field DATABASE DIRECTORY “"

and press the Execute button; 

specify the path to the created database in the DBMS LINTER performance management window (see the part “Database Location” in the “DBMS LINTER Performance Management” section) beforehand (before creating the database).

If the specified directory does not exist, it will be created. The database will be created in the /db subdirectory of the /data/data/com.relex.linter DBMS LINTER installation directory by default (if a different location is not specified). 5) enter the name of the created database (maximum 18 Roman alphanumeric characters) in the type commands or enter DB name input field and press the Generate DB button to create a database with default parameters;

Using DBMS LINTER on Android OS Platform

11

Creating and Configuring a Database 6) enter the CTREATE DATABASE … gendb utility command in the type commands or enter DB name input field and press the Execute button to create a database with user parameters; The database creation process will be displayed in the database creation window (Fig. 4). To create multiple databases, execute the above-described operations specifying a new database location each time. If you need to re-create a database in the same directory it was created in, you need to delete all the files from the directory first.

Creating the System Tables To create database system tables: 1) select the RDBMS Linter SQL menu option from the main menu of the Android OS device (Fig. Fig. 1); 2) press the Tools button in the DBMS LINTER operating menu (Fig. 2); 3) select the INL option from the available tool menu (Fig. 3) to activate the window for operating the DBMS LINTER Command Interface (рис. 5); 4) access the list of available SQL scripts for creating the system tables (use the Show config SQL-files for executing button if the SQL script list is currently hidden) in the window (Fig. 5).

Fig. 5. Command Interface Operating Window

12

Using DBMS LINTER on Android OS Platform

Creating and Configuring a Database 5) select (check) the SQL scripts to be executed. The SQL script choice depends on the functional requirements to the database: Table 2. SQL Scripts for Creating the System Tables SQL Script Name systab search, default distr events arepl security, extsec cstables, charsets mbcps pbcat cerrorsl

inkernel.sql

Functional Capability Support Triggers, stored procedures and queues Full-text search Distributed data processing Event management Asynchronous data replication Extended information security facilities Encoding directory (versions 6.x and later). Single-byte encodings Multi-byte encodings For operating PowerBuilder Creating an empty DBMS LINTER kernel termination code table. Termination codes and the corresponding texts are uploaded into the table from the errors.lod file by the kernel For the work of the data backup system

6) press the Execute button.

Configuring a Database To configure a database: 1) select the RDBMS Linter SQL menu option from the main menu of the Android OS device (Fig. Fig. 1); 2) press the Tools button in the DBMS LINTER operating menu (Fig. 2); 3) select the GenDB option from the available tool menu (Fig. 3) to activate the window for operating the DBMS LINTER Command Interface (Fig. 5); 4) specify the location of the configured database beforehand (before configuring it). To do this: 5) enter the following gendb utility command in the type commands or enter DB name input field DATABASE DIRECTORY “"

and press the Execute button; 

specify the path to the created database in the DBMS LINTER performance management window (see “Database Location” in the “DBMS LINTER Performance Management” section) beforehand (before creating the database).

6) enter the SET … DBMS LINTER gendb utility command with the required database configuration parameters in the type commands or enter DB name input field and pressing the Execute button.



It is allowed to enter a group of SET commands, i.e. the following variants can be used: 1 SET SYSSRT LIMIT 5;SET TABLES 100;SET

Using DBMS LINTER on Android OS Platform

AUTOCONFIG ON;

13

Creating and Configuring a Database 2 SET SYSSRT LIMIT5; SET TABLES100; SET AUTOCONFIG ON;

14

Using DBMS LINTER on Android OS Platform

DBMS Performance Management Setting the DBMS Launch Parameters To set (alter) the DBMS LINTER kernel launch parameters: 1) select the RDBMS Linter SQL menu option from the main menu of the Android OS device (Fig. Fig. 1); 2) press the Launch Settings button in the DBMS LINTER operating menu (Fig. 2) to activate the window for altering some DBMS LINTER kernel launch parameters (Fig. 6);

Fig. 6. DBMS Kernel Launch Parameters 3) enable the Start at system startup switch in order for the DBMS LINTER kernel to start automatically upon the Android OS start (disable the switch to launch the kernel manually); 4) enable the Ignore the difference in the start time of DB engine (TCORRECT) switch to ignore the time difference in case the date of the last DBMS launch is future in

15

Using DBMS LINTER on Android OS Platform

DBMS Performance Management

5) 6) 7) 8) 9)

comparison to the current Android OS date. If a time difference is detected during the kernel launch while this switch is disabled, the kernel will not be launched; enter the full path to the database the DBMS LINTER kernel is to be launched with in the DB directory path field or using the offered directory; specify the kernel pool size in the DB Memory pool size of the DB engine field (an equivalent of the /POOL key) or using the offered value; specify the kernel sorting process pool size in the DB Memory pool size of the sort process field (an equivalent of the /SPOOL key) or using the offered value; press the Save button; use the Cancel button to discard the alterations.

 If the performance parameters are altered while the DBMS LINTER kernel is active, the alterations will take effect only after the kernel is restarted.

DBMS Launch To launch the DBMS LINTER kernel: 1) select the RDBMS Linter SQL menu option from the main menu of the Android OS device (Fig. Fig. 1). The Core status indicator shows the current DBMS kernel state on the device: - inactive, - active; 2) press the Start button to start the kernel (available only when the kernel is inactive; launching multiple copies of DBMS LINTER kernel at the same time is prohibited); 3) the kernel launch log will be output onto the screen (Fig. 7).

16

Using DBMS LINTER on Android OS Platform

DBMS Performance Management

Fig. 7. DBMS LINTER Kernel Launch Log

DBMS Shutdown To shut down the DBMS LINTER kernel: 1) select the RDBMS Linter SQL menu option from the main menu of the Android OS device (Fig. Fig. 1). The Core status indicator shows the current DBMS kernel state on the device: - inactive, - active; 2) press the Stop button to shut down the kernel (available only when the kernel is active).

Using DBMS LINTER on Android OS Platform

17

DBMS Performance Management

DBMS Restart To restart the DBMS LINTER kernel: 1) select the RDBMS Linter SQL menu option from the main menu of the Android OS device (Fig. Fig. 1). The Core status indicator shows the current DBMS kernel state on the device: - inactive, - active; 2) press the Restart button to restart the kernel (i.e. to shut it down and then launch it again; available only when the kernel is active).

18

Using DBMS LINTER on Android OS Platform

DBMS Tools The following DBMS LINTER tools are available on an Android OS device: 1) command interface; 2) database creation and configuring utility (described in the “Creating and Configuring a Database” section); 3) user SQL script management; 4) DBMS LINTER speed characteristic test; 5) database backup copying utility; 6) “LINTER Desktop” utility.

Command Interface The inl (Interactive SQL Language) utility allows users to work with the DBMS LINTER in the interactive command mode: 

inputting and executing SQL queries;



executing SQL scripts;



creating triggers and stored procedures;



saving the results of executing SQL queries and SQL scripts in a file;



operating BLOB data;



representing the results of executing search queries in a table form;



executing simple editing of search query results;



accessing the database object information

etc. The full list of the utility features is given in the “DBMS LINTER. Command Interface” document. To operate the command interface: 1) activate the DBMS LINTER kernel (see the “DBMS LINTER Launch” section); 2) select the RDBMS Linter SQL menu option from the main menu of the Android OS device (Fig. Fig. 1) to activate the DBMS LINTER operating menu (Fig. 2); 3) press the Tools button in the DBMS LINTER operating menu to activate the window with the list of available tools (Fig. 3); 4) select the INL option in the available tool window (Fig. 3) to generate the command interface invitation: SQL>

19

Using DBMS LINTER on Android OS Platform

DBMS Tools Command interface operating example: … SQL>time SQL>count SQL>select count(*) from auto where year=70; | 465| SQL>

User SQL Script Collection The “User SQL Script Management” tool provides the user with a set of tools to work with SQL scripts created and located on the Android OS device. The tool allows the user to create a collection of SQL scripts to work on the Android OS device.

Initializing the Work with the SQL Script Collection To initialize the SQL script collection management tool: 1) select the RDBMS Linter SQL menu option from the main menu of the Android OS device (Fig. Fig. 1) to activate the DBMS LINTER operating menu (Fig. 2); 2) press the Tools button in the DBMS LINTER operating menu to activate the window with the list of available tools (Fig. 3); 3) select the Customer’s scripts option in the available tool window (Fig. 3) to activate the window with the current contents of the SQL script collection and the menu of operating the collection (Fig. 8).

20

Using DBMS LINTER on Android OS Platform

DBMS Tools

Fig. 8. User SQL Script Collection Management Menu

Adding An SQL Script to the Collection To add an SQL script to the user SQL script collection: 1) initialize the SQL script collection management tool; 2) press the Add button in the user SQL script collection management menu to activate the window of adding an SQL script to the collection (Fig. 9);

Using DBMS LINTER on Android OS Platform

21

DBMS Tools

3) 4) 5) 6)

Fig. 9. Adding an SQL Script to the Collection enter the full specification of the added SQL script (directory and file name) in the type path to script field; enter the explicative text (comment) containing the functional purpose of the SQL script in the type script description field; press the Save button; press the Cancel button to discard the addition of the SQL script to the collection.

Viewing the SQL Script Text To view the SQL script text : 1) initialize the SQL script collection management tool; 2) select the necessary SQL script from the list (set the check mark); 3) press the Browse button in the user SQL script collection management menu to activate the window of viewing the SQL script collection (Fig. 10);

22

Using DBMS LINTER on Android OS Platform

DBMS Tools

Fig. 10. SQL Script Text Viewing Window 4) press the Close button after the viewing.

Executing an SQL Script from the Collection To execute an SQL script from the collection: 1) 2) 3) 4)

activate the DBMS LINTER kernel; initialize the SQL script collection management tool; select the SQL script from the list (check); press the Execute selected button in the user SQL script collection management menu.

Deleting an SQL Script from the Collection To delete an SQL script from the collection: 1) initialize the SQL script collection management tool; 2) select the SQL script from the list check);

Using DBMS LINTER on Android OS Platform

23

DBMS Tools 3) press the Delete selected button in the user SQL script collection management menu.

 The SQL script will be deleted only from the SQL script collection and will remain on the Android OS device.

Editing the SQL Script Infromation To edit the information about an SQL script from the collection (for example, the SQL script location, name or functional purpose): 1) initialize the SQL script collection management tool; 2) select the SQL script from the list (check); 3) press the Edit button in the user SQL script collection management menu to activate the SQL script information editing window (Fig. 9); 4) alter (if necessary) the SQL script specification (directory and file name) in the type path to script field; 5) alter (if necessary) the explicative text (comment) containing the functional purpose of the SQL script in the type script description field; 6) press the Save button; 7) press the Cancel button to discard the SQL script changes added to the collection.

Speed Characteristic Test The speed characteristic test (see the “DBMS LINTER. Speed Characteristic Test” document) allows the DBMS LINTER users to check its performance parameters on the Android OS platform. To launch the test: 1) activate the DBMS LINTER kernel (see the “DBMS LINTER Launch” section); 2) select the RDBMS Linter SQL menu option from the main menu of the Android OS device (Fig. Fig. 1) to activate the DBMS LINTER operating menu (Fig. 2); 3) press the Tools button in the DBMS LINTER operating menu to activate the window with the list of available tools (Fig. 3); 4) select the TPC-B option in the available tool window (Fig. 3) to activate the TPC-B utility window (Fig. 11); 5) enter the number of records in the table created for testing; 6) press the Start button.

24

Using DBMS LINTER on Android OS Platform

DBMS Tools

Fig. 11. TPC-B Utility Launch Window

Backup Copying The “Database Backup Copying” tool is used to copy information from the LINTER database to a compressed database file archive (a zip-archive on the Android OS device or an external detachable device such as MicroSD card) or to the database backup file (lhb archive). A database saved as a zip-archive can be restored using the Android OS facilities. To restore a database saved as an lhb archive: 1) copy the database lhb archive from the Android OS device to the host computer; 2) use the lhb utility on the host computer to restore the database from the backup lhb file; 3) copy the restored database files from the host computer to the database directory on the Android OS device.

 The zip-archive can be created when the DBMS LINTER kernel is active or inactive. If the DBMS kernel is active, the already archived files may be altered during the archiving process, so the database restored from this archive may not fully match the actual database. To create the database zip-archive:

Using DBMS LINTER on Android OS Platform

25

DBMS Tools 1) select the RDBMS Linter SQL menu option from the main menu of the Android OS device (Fig. Fig. 1) to activate the DBMS LINTER operating menu (Fig. 2); 2) specify the archived database location directory (see the “Setting the DBMS Launch Parameters” section); 3) press the Tools button in the DBMS LINTER operating menu to activate the window with the list of available tools (Fig. 3); 4) select the DB backup option in the available tool window (Fig. 3) to activate the backup copying window (Fig. 12); 5) specify the created zip-archive location (Save on file system or Save on SD card); 6) input the full path to the directory for placing the database zip-archive in the Path to save field. If the specified directory does not exist, it will be created; 7) press the Backup button under the Path to save field. To create the database lhb archive: 1) activate the DBMS LINTER kernel; 2) select the RDBMS Linter SQL menu option from the main menu of the Android OS device (Fig. Fig. 1) to activate the DBMS LINTER operating menu (Fig. 2); 3) press the Tools button in the DBMS LINTER operating menu to activate the window with the list of available tools (Fig. 3); 4) select the DB backup option in the available tool window (Fig. 3) to activate the backup copying window (Fig. 12); 5) enter the name of the created database lhb archive in the Archive file name field; 6) press the OnlineBackup button.

26

Using DBMS LINTER on Android OS Platform

DBMS Tools

Fig. 12. Database Backup Copying Management Window

LINTER Desktop The graphic “LINTER Desktop” interface utility (see the “DBMS LINTER. LINTER Desktop” document) provides ample opportunities for working with a database: table processing (creating, viewing, editing, uploading/unloading), creating and deleting indexes, managing the table access rights, setting different transaction processing modes, forming and executing the database queries, restoring the damaged physical database file structures and a lot more.

 Working with the utility requires the Android OS device CRT size to be at least 7 inches. To launch the utility: 1) activate the DBMS LINTER kernel (see the “DBMS LINTER Launch” section);

Using DBMS LINTER on Android OS Platform

27

DBMS Tools 2) select the RDBMS Linter SQL menu option from the main menu of the Android OS device (Fig. Fig. 1) to activate the DBMS LINTER operating menu (Fig. 2); 3) press the Tools button in the DBMS LINTER operating menu to activate the window with the list of available tools (Fig. 3); 4) select the Lindesk option in the available tool window (Fig. 3) to activate the main utility panel (Fig. 13), after which working with the utility is performed in accordance with its accompanying documentation.

Fig. 13. The Main “LINTER Desktop” Utility Menu

28

Using DBMS LINTER on Android OS Platform

Interfaces of Client Applications Interacting with DBMS LINTER JAVA Applications The interaction of JAVA applications with the DBMS LINTER kernel on an Android OS device based on the Call interface is basically the same as interaction of client applications written in the С/C++ programming language, but there are some special features defined by the specifics of developing and launching the JAVA applications for Android OS. The main inter function of the Call interface is implemented as the shared libintlib.so library (located in the lib subdirectory of the DBMS LINTER installation directory on the Android OS device). The header files required for developing the client applications (inter.h etc.) are located in the files/call subdirectory of the DBMS LINTER installation directory on the Android OS device. Launching the functions for direct access to the DBMS LINTER kernel from the JAVA code is implemented by using the JNI (Java Native Interface) mechanism. To do so, the application developer must create a class containing the JAVA direct access function implementation (i.e. a class that calls the inter function of the Call interface). Accessing the Call interface requires including the inter.h header file in this class. It should be noted that in accordance with the JNI rules the functions to be called from the JAVA code in the future have a specific name format. Here is an example of a class containing the reference to the inter Call interface function with the OPEN command (creating a connection to the database): #include #include #include "inter.h" L_LONG LinterOPEN(TCBL *pCBL, L_CHAR *Name_Pass, L_CHAR *Node, L_WORD Prior, L_LONG PrzExe) { memcpy(pCBL->Command, "OPEN", 4); if (strlen(Node) > MAX_NODE_LEN) { return SQLLONGID; } memset(pCBL->Node, 0, MAX_NODE_LEN); memcpy(pCBL->Node, Node, strlen(Node)); pCBL->PrzExe = PrzExe; pCBL->Prior = Prior; pCBL->PrzExe &= ~Q_ASYNC; inter(pCBL, (void *)Name_Pass, NULL, NULL, NULL);

29

Using DBMS LINTER on Android OS Platform

Interfaces of Client Applications Interacting with DBMS LINTER return pCBL->CodErr; } jint Java_com_relex_sample_CallSample_testCALLInterface(JNIEnv *env, jobject thiz) { TCBL CBLconnect; CHAR Name_Pass[]="SYSTEM/MANAGER"; CHAR Node[]=" "; WORD Priority=0; LONGINT PrzExe= Q_ENCODE | M_BINARY; LONGINT Err;

PrzExe);

setenv("LINTER_TMP", "/data/data/com.relex.linter/tmp", 1); Err=LinterOPEN(&CBLconnect, Name_Pass, Node, Priority, return Err;

}

The next step is to create a shared library (.so) based on this class using the ndk-build utility of the android-ndk package. The rules of assembling this shared library using the ndkbuildTimes utility are contained in the Android.mk file. Assembling the library successfully requires specifying the _VER_MAX macros in the .mk file (for more information about the macros see http://linter.ru/ru/documentation/pdf_linter_2012/pdf_2012/call.pdf) and the libintlib.so library. In the future the assembled library must be copied to the lib subdirectory of the DBMS LINTER installation directory together with the libintlib.so library during the client application installation in order to be able to upload this library from the JAVA code afterwards. Here is an example of the Android.mk file: LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := call-sample LOCAL_SRC_FILES := call-sample.c LOCAL_CFLAGS := -D_VER_MAX=600 LOCAL_LDLIBS := -L$(LOCAL_PATH) -lintlib include $(BUILD_SHARED_LIBRARY)

Finally, the direct access function in the JAVA code should be called. To do this: 

upload the shared library containing the function implementation using the System.loadLibrary(library name) structure in the JAVA class prior to calling the function;



upload the libintlib.so library using the System.loadLibrary(“intlib”)’ structure;



specify the JAVA direct access method corresponding to the name of the function called from the shared library in accordance with the JNI rules.

For more information about launching the direct access code from an Android application see the Android NDK package accompanying documentation. Here is an example of a JAVA class (Android-activity) containing the native function reference: package com.relex.sample; import android.app.Activity; import android.widget.TextView; import android.os.Bundle;

30

Using DBMS LINTER on Android OS Platform

Interfaces of Client Applications Interacting with DBMS LINTER public class CallSample extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); TextView tv = new TextView(this); String text = ""; text = "Beginning to test CALL-interface...\n\n" + "Try to open connection...\n";

int code = testCALLInterface(); if (code == 0) { text += "Successfully!\n"; } else { text += "Error! Linter error code is " + code + "\n"; } tv.setText(text); setContentView(tv); } public native int testCALLInterface();

}

static { System.loadLibrary("intlib"); System.loadLibrary("call-sample"); }

С/С++ Applications The interaction of Android client applications written in the С/C++ programming language with the DBMS LINTER kernel using the Call interface is implemented in accordance with the same rules as in other operating systems (see the “DBMS LINTER. Call Interface” document).

JDBC Interface Working with the LINTER JDBC driver in an Android application is no different than working with the JDBC driver in a standard JAVA application (see the “DBMS LINTER. JDBC Driver” document). In order for the JDBC driver to interact with the linapid JDBC driver you must add the following line to the Android.xml application description file (granting the Internet access):

31

Network Access to the DBMS The DBMS LINTER network facilities provide the following remote database access configurations: 1 host computer (LINTER-server) Android OS device (client application); 2 host computer (client application) Android OS device (LINTER-server); 3 Android OS device (LINTER-server) Android OS device (client application). All three variants require using the TCP/IP protocol. The default port for interaction between two Android OS devices is port XXXX. An example of the nodetab configuration file string upon the interaction between two Android OS devices: #NODENAME PROTOCOL

HOST

PORT

TIMEOUT

MY TCPIP localhost 1060 1 The server network driver (which is lindbs_tcp.so in Android OS) must be launched on the LINTER-server, and the client network driver (which is lindbс_tcp.so in Android OS) must be launched on the client end.

32

Using DBMS LINTER on Android OS Platform

Diagnostic Messages Message Ministro service not found. Cannot launch the application.

Cause The Ministro application is not installed on the Android device. Ministro is an Android OS application used for uploading and installing the Qt-libraries required for different applications working on the Qt-platform. This message is output when launching an application that needs the missing Qt-library. Recommendations The Ministro Android application must be installed. It can be found on the official website for distributing the Android Google Play applications. After installing Ministro, the Lindesk utility must be restarted. Message This application requires Ministro service. Do you want to install it?

Cause The Ministro application is not installed on the Android device. The device has access to Google Play and can partially install Ministro automatically. Recommendations Press the affirmative answer button. The Ministro installation process will be started. During the installation process you may be asked some additional questions. You must answer these questions. As a result, the Ministro application and Qt-libraries required for Lindesk will be installed. Message Yo u r a p p l i c a t i o n e x p e r i e n c e d a f a t a l e r r o r a n d c a n n o t f u n c t i o n a n y m o r e .

Cause An internal Lindesk utility error. Recommendations Restart Lindesk.

Using DBMS LINTER on Android OS Platform

33

Readers Questionnaire The purpose of this questionnaire is gathering information to create documentation which fully meets the requirements of our clients. Please fill it in and send it to us using one of the following ways:  by fax:+7 (473) 2-711-711, 2-778-333.  by e-mail: [email protected]. Using DBMS LINTER on Android OS Platform Question Outline the Right Answer Yes / No Was the information full enough? Yes / No Was it easy to find the required information? Yes / No Is the information expounded accessibly?

What did you particularly like (dislike) about the organization, information setup, style and design of the document?

Name: Position: Company: Address: Phone: е-mail:

Notes On this page you can write down your comments and everything you consider necessary to say to the staff of RELEX.

Using DBMS Linter on Android OS Platform

35