Android Development two ways to operate a database using the Sqlite3 tool

Source: Internet
Author: User

two ways to manipulate a database using the Sqlite3 tool Please respect other people's labor results, reproduced please specify the Source:Android Development using the Sqlite3 tool to operate the database two ways
http://blog.csdn.net/fengyuzhengfan/article/details/40193123

A "Sqlite3.exe tool" is provided under the Tools folder of the Android SDK, which is a simple SQLite database management tool, similar to the command line form provided by MySQL at some point, developers use the tool to inquire and manage databases.

Here are two ways to do this:

The first way:

1. Add the tools path under the SDK folder to the PATH environment variable.

2 . Import the. db3 database into your computer such as (D:/MY.DB3)

3. cmd execution sqlite3 d:/my.db3

4. You can open the MY.DB3 database.

Another way:

Open the SQLite database for the application in the virtual machine:

1. Under DOS, enter the ADB shell into the virtual machine's Android system


Tips: 1. because android is based on The Linux kernel, linux can be used here command to perform some operations.

2. assume that the "adb does not " internal or external command is indicated. You need to add the sdk\platform-tools to the system path variable via the SDK ....

2. Then enter sqlite3 data/data/ Your application package name /databases/ your database name .

You can open it. For example, with:


Tips: SQLite agreeing to save all types of data to whatever type of field the developer is not concerned about declaring the data type used by the field. For example, the program can put the value of the string type in the field of the INTEGER type, but also can put the value type of the values of the Boolean type of the field ... But there is a situation exception: defined as integerprimary KEY the field can only store - a bit integer that, when saved to such a field, An integer other than the type of data. SQLite can produce errors.

because SQLite agreeing to ignore the actual data type of the underlying data column when depositing data, so you can with the type declaration following the Collo data column, such as SQL Statement for SQLite is also correct.

Android Development two ways to operate a database using the Sqlite3 tool

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.