First, write a class to inherit Sqliteopenhelper class
Rewrite his method to specify the name, version of DB, rewrite the Oncreat and Onupgrade methods, write SQL statements to create a table
public class Mysqliteopenhelper extends
problem: If there is a student table in the SQLite database, you now need to insert the data into the table, or insert if there is no record with the same name.Answer: Use the NOT EXISTS statement as follows:insert INTO [Student] ([Name], [age])
The same SQL statement, the data can not be found toSELECT * FROM table1 where t1>= ' 2017-6-1 ' and t1Change intoSELECT * FROM table1 where t1>= ' 2017-06-01 ' and t1So that we can find out the data toThe T1 in the database can be set to the text
Recently, sqlite3 is used. SQL statements are used to perform database operations in the same way as other databases. If you have just used sqlite3, you may find that the path contains Chinese characters, and opening fails, mainly because of the
Because it is difficult to change files in XML storage, we finally chose to use database storage.
A try is very convenient and fast
Source code:
Public class dbhelper extends sqliteopenhelper {private final static string database_name =
This article Reprinted from http://www.tntserver.cn/article.asp? Id = 41
I encountered a problem today.First, insert a data in datatime format:String SQL = "insert into [Table] (date_time) values ('" +Date_time.tostring ()+ "'";Execute the
SQLite is a simplified version of MySQL. It is used on mobile devices or small devices. The advantage of SQLite is its portability. It can run without a server. It also has some defects. First, it does not provide a simple database creation method
During SQLite transaction processing, a default statement is a transaction when SQLite inserts data, disk operations such as 5000 records mean 5000 disk read/write operations.Solution:Add transaction processing and insert 5000 records as a
--------------------------------------------------------------------------------
(1) how to create an auto-increment field?
A simple answer: a field declared as integer primary key will be automatically added.
Here is a detailed answer: Starting
Mrdb blog
SQLite introduction and analysis (1) --- IntroductionIntroduction and Analysis of SQLite (ii) --- introduction and analysis of design and concepts SQLite (iii) --- kernel Overview (1) SQLite getting started and Analysis (3) --- kernel
SQLite Foreign keys FAQ: Can you show me how to defineForeign keysIn a SQLite database table design?
The SQLite database does supportForeign keys, And its foreign key syntax is similar to other databases. Here's a quick SQLite foreign key example.A
Today, due to SQLite paging, it took a few hours!
SQLite starts from the third page and only displays data on the second page!
When checking that your code is correct, start to suspect that there is a problem with nhib.pdf processing SQLite
SMS messages of Android are stored in the SQLite database in the Android system, but are not accessible to other programs (Security Mechanism of Android)
Now we are reading SMS messages from our mobile phone, saving them in our own SQLite database,
Reposted on this blog (thanks to this friend ):
Http://hi.baidu.com/3g13/blog/item/f12dc5131313aa1e5baf5301.html
I have always liked text-based databases, which are simple, convenient, and easy to save. Recently, the MySQL database of a website
SQLite is an open-source, cross-platform lightweight database. WINCE also has its own database SQLCE, But it occupies a large amount of resources. SQLite has been used in recent projects, so we have made a special research. Here we will introduce
Previously, a WebService Service was compiled in the company. Only by calling the service can we continue the subsequent operations. In the WebService, we saved the cookie and processed the session, at that time, the session was stored through hash,
IOS sqlite database operations. Steps:
First join the sqlite Development Library libsqlite3.dylib,
Create or open a database,
Create a data table,
Insert data,
Query and print data1. Create a project sqliteDemo and add the library libsqlite3.dylib
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