Example Uses

To run the application the JDBC database needs to be invoked. The application will access the data from the remote JDBC database. To put data into the database the desired table has first to be created and the types of the columns have to be specified. Our example needs exactly one table. The table can be created with the following statement. The column type NVAR-CHAR indicates that we desire to store national strings which can mean Unicode. Other data-base management systems might need a different declaration.

CREATE TABLE employee (
firstname NVARCHAR(50) NOT NULL,
name NVARCHAR(50) NOT NULL,
age INTEGER NOT NULL,
salary INTEGER NOT NULL);

To put data into the database we can individually insert rows. Our example needs an insert statement for each employee tuple. Statements of the following form can be used. The N be-fore an SQL literal indicates that the literal is national encoded. Other database management systems might need a different encoding of the SQL literal. After the schema has been defined and the database has been populate, the database management systems needs to be running and the JDBC connection port needs to be accessible.

INSERT INTO employee(firstname, name, age, salary)
VALUES (N'Сергей', N'Иванов', 53, 18500);
INSERT INTO employee(firstname, name, age, salary)
VALUES (N'Сергей', N'Беляев', 53, 19000);
[…]

The database application can be run with the JDBC driver class in the class path. We will again directly head towards testing the behaviour of Unicode queries. In the client application the Unicode travelled a HTTP request and HTTP response. In the database application the Unicode will travel the JDBC driver and the database management system. It seems that everything works fine. The result of the search for the name ‘Иванов’ [Iwanov] in the database frame can be seen here:


Picture 19: Database Frame Unicode Search

Comments