Third, efficient bulk data insertion:
A brief description of the bulk insert concept before giving the procedure is given to help you read the sample code that followed. In fact, BULK INSERT is not a new concept, in other relational database of the
This paper mainly explains the analysis and summarization of time function in SQLite and gives the use case. The examples given in this article are all tested.SQLite Time/Date function type:1. DateTime (): Date and time of production2, Date ():
Original address: http://www.cnblogs.com/wangmars/p/3914090.htmlSQLite, is a lightweight database, is widely used in a lot of embedded products, because the use of very little resources, two of the operation of the way almost and we contact the
How to back up the entire database:#Coding=utf-8ImportSqlite3defTestbaksqlite (): Conn= Sqlite3.connect ("sqlite_db_mine/testdb.db") with open ('TestDB.sql.bak','W') as F: forLineinchconn.iterdump (): Data= line +'\ n'Data= Data.encode ("Utf-8")
SQLite can be downloaded to the official site (http://www.sqlite.org/download.html): Linux,mac OS X, compiled files under Windows, and source code, help documentation.SQLite official download is only available to us a sqlite3.dll with a sqlite3.def
For example, I have a Sqlite3 type database created with SQLite Studio, and a table structure with table name Statisticsdata is:--table: StatisticsdataCREATE TABLE"Statisticsdata" ("Id" )TEXT not NULL, "MachineName"NVARCHAR, "SessionId"INTEGER,
SQLite does not support TRUNCATE TABLE statementsWay One:DELETE from [tab_user] -- You cannot reset the increment number to zeroWay two:DELETE from WHERE = -- you can reset the increment number to zeroRead more about my introduction from other Bo
Sqlite3_exec Although good, but generally not recommended for direct use.A common set of actions is:For sqlite3_exec and SQLITE3_PREPARE_V2 usage scenarios, the following are recommended:A small demo:#include #includeintMainintargcChar**argv)
There is an add-on column named ID in the SQLite database, and the project needs to return the ID of the newly inserted data row while inserting new data into the database.I use transactions here to commit the INSERT and query statements together
I. Introduction to SQLite
On the Android platform, an embedded relational database named SQLite and sqlite3 is integrated.SupportedNull, integer, real (floating point number), text (string text), blob (binary object) data type,Although it
Android provides four data storage methods. Because Android data is basically privateProgramTo use the data, you must use the contentproviders provided by Android.
Four Data Storage Methods in Android:
Shared preferences
Similar to our
Prepare is used to initialize the pre-SQL statement finalize the SQL statement used to release prepare
Reset is used to reset pre-SQL statements for reuse ..Exec is used to directly execute non-seletc SQL statements. If okstep is returned
Haha, I am getting smarter. I 've been pouring a 2.2 source code package over the past few days and running the database that fast, but the above error sqlite3_open_v2 ("/data/COM. android. packagename/databases/dump. SQLite ", & handle, 1, null)
Http://www.hiapk.com/bbs/thread-57703-1-1.html
Use androidThe sqliteopenhelper In the SDK can be used to conveniently operate the SQLite database.Platform limitations: SQLite on mobile phones cannot perform very complex select operations, but the
SQLite database third-party Java extensions: http://www.zentus.com/sqlitejdbc/
There are 2 packages, one is nested (embedded) and the other is native (local ).
The difference is: Nested does not require additional DLL files, but it is slow. Native
Transaction type:
There are three different types of transactions that start transactions in Different lock states.
Specify the transaction type in the begin command: Begin [deferred | immediate | exclusive] transaction;
Deferred must be used to
The farmer's uncle wrote quite well, you can read: http://www.cnblogs.com/over140/archive/2010/08/11/1792482.html
Preface
How can I publish the SQLite database and APK together? At the beginning, a friend told me to directly use the ADB command
Before using C ++ to operate SQLite, You need to obtain sqlite3.h, sqlite3.lib, and sqlite3.dll.
HereDownload. And import the three files into the VC ++ project. Put the sqlite3.dll file in the debug folder. SQLite API introduction int sqlite3_open (
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