Phone book written using the RMS Engine

Source: Internet
Author: User

Phone book written using the RMS Engine

Recently, some projects have found that a large number of applications of RMS operations are required. The rms api provided by Sun is not very convenient. Crud is very troublesome for data. Therefore, it is a good idea to implement a small Data Engine Based on RMS. I temporarily call this Data Engine
Figo. The Chinese name is Feige.
What my engine can do is:
1. Operations on tables-add and delete. Modifications to tables are not supported.
2. Operations on table data-add, delete, modify, and query (only one keyword can be queried)

Let's take a look at my SQL statements.
Because it is a simple and small database. So I simplified SQL. The following is a complete Operation Method
1. Add Table
Create table_name column_1 column_2 column_3 ......
Drop table_name

2. Data Operations
Insert table_name column_1... for this operation, and then call setstring (index, value) in the API)
Update table_name set... where column_1 = key;
Select table_name f_id = 1;

The above is the theory, the following is the practice, the source code package, including a simple phone book example,

Image Appreciation



When I was in a bad mood yesterday and couldn't sleep at night, I thought about a simple example of the RMS engine I sent last time. So I wrote a simple phone book.
The functions are as follows:
1. Add
2. Query
3. list all documents
The unimplemented function is left to the netizens for their own design. Very simple. Ha
1. Modify
2. Delete
3. Sorting

Download the source code here
Phone book written using the RMS Engine

Project requirements
Design a telephone book application.
This program is used for learning and communication, and cannot be used for commercial applications. Please contact me if necessary.
Program functions
1. Add contact information including name, mobile phone, email, and address.
2. Modify contact information.
3. query contact information,
4. delete a contact.

Project design
1. using the simple RMS Data Engine written by myself is also a rich example for everyone to learn and exchange.
2. Advanced UI display.
3. The overall architecture adopts the MVC structure, which is commonly used on the Web. It fully demonstrates the flexibility of the j2_design and has little performance problems.

Here we will introduce several core system interfaces.
Resultset --- structure set for data operations. For example, an available structure will be returned during query. The usage in the structure is similar to that in JDBC.
Query --- execute the custom SQL statement, and execute the resultset structure.
Databaseserver --- starts the RMS engine, closes. resource processing, and avoids the trouble of directly operating RMS exceptions.
Querybuilder --- static factory class. You can use SQL to create a query instance.

Custom SQL syntax Design
For example, the table creation syntax is
Create: Friend: f_name: f_mobile: f_email: f_address
Insert data as follows:
Query q = querybuilder. Builder ("insert: Friend: f_name: f_mobile: f_email: f_address ");
Q. setstring ("f_name", friend. getname ());
Q. setstring ("f_mobile", friend. getphone ());
Q. setstring ("f_email", friend. getemail ());
Q. setstring ("f_address", friend. getaddress ());
Q.exe cute ();
The data to be deleted is:
For your reference

Modify data as follows:
For your reference

To delete a table, follow these steps:
For your reference

By the way:
1. This engine can only add text, not images, and is intended to be added in later versions.
2. Some netizens have modified this version and applied it to their projects. They also mentioned some related issues.
3. Recently, I may also want to use this engine to implement some j2s projects, which will be continuously improved and maintained stable.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.