Android development: Using sqlite3 to operate databases

Source: Internet
Author: User

Android development: Using sqlite3 to operate databases
You can use the sqlite3 tool to operate databases in two ways, so that you can respect others' labor results. For more information, see the source: Android development uses the sqlite3 tool to operate databases.
Http://blog.csdn.net/fengyuzhengfan/article/details/40193123

The "sqlite3.exe" tool is provided in the tools directory of the Android SDK. It is a simple SQLite database management tool, similar to the command line window provided by MySQL. Sometimes, developers use this tool to query and manage databases.

The following two methods are described:

Method 1:

1. Add the tools path under the sdk directory to the path environment variable.

2. Import the. db3 database to a computer (D:/my. db3)

3. Run sqlite3 d:/my. db3 in Cmd.

4. You can open the my. db3 database.

Method 2:

Open the sqlite database of the application in the virtual machine:

1. Enter adb shell in dos to enter the android system of the VM.


Tip: 1. Because android is based on the linux kernel, you can use linux commands to perform some operations here.

2. If the system prompts "adb not" internal or external commands, you need to use the sdk... Add sdk \ platform-tools to the system path variable.

2. Then enter sqlite3 data/your application package name/databases/your database name. To open, such:


Tip: SQLite allows you to save various types of data to any type field. Developers do not need to declare the data type used by this field. For example, a program can store string-type values in INTEGER fields, or store numeric values in Boolean fields ...... One exception is that fields defined as integerprimary key can only store 64-bit integers. SQLite produces errors when saving data of other types than Integers to such fields.

Since SQLite allows you to ignore the actual data type of the underlying data column when storing data, you can use the type declaration following the data column when writing the table creation statement, for example, the following SQL statement is correct for SQLite.

Related Article

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.