寶馬2019年9月上旬最新中文數據庫SQLiteDBs 4.19.12支持新款F、G和I系列車(chē)型,以及勞斯萊斯,MINI,寶馬摩托。
新版本提供Multi-VCI,可支持D-CAN線(xiàn),ENET線(xiàn),ICOM,OPS/GT1直接連接診斷。
可查看維修資料、電路圖等等 。
包含以下文件:
DiagDocDb.sqlite
streamdataprimitive_OTHER.sqlite
streamdataprimitive_ZHCN.sqlite
xmlvalueprimitive_OTHER.sqlite
xmlvalueprimitive_ZHCN.sqlite
注意事項:
1、購買(mǎi)本數據庫,寶馬匯只提供數據下載,不支持任何免費技術(shù)支持,如需有償技術(shù)支持請點(diǎn)擊這里。
2、本站所售商品為虛擬物品,鏈接一旦發(fā)出,概不退款。
3、獲取中文數據庫“解壓密碼”,需要支付網(wǎng)站30元,點(diǎn)擊下方的地址購買(mǎi)。
購買(mǎi)地址:
手機或電腦登錄微店購買(mǎi)
到寶馬匯網(wǎng)站查看此地圖
1。
創(chuàng )建一個(gè)新的通用應用程序 2。在Visual Studio 2015上安裝SQLite Visual Studio拓展包(點(diǎn)此下載) 3。
添加NuGet包,運行程序包管理器控制臺命令:Install-Package SQLite。Net-PCL 4。
增加所需的參照:在Windows通用 -擴展中找到通用應用程序平臺的SQLite,并在SQLite擴展安裝進(jìn)行到第2步時(shí)添加 5。更新MainPage。
xaml 6。創(chuàng )建消息模型:創(chuàng )建一個(gè)模型,并用SQLite來(lái)存儲數據。
該模型被轉換成本地數據庫中的表。 普通的模型和使用SQLite的唯一區別是,必須添加一些額外的屬性,例如:[主鍵,自動(dòng)遞增]。
要利用這些屬性,必須添加以下引用:using SQLite。Net。
Attributes; 7。串聯(lián)所有的東西:轉至MainPage。
xaml的代碼;定位SQLite文件;建立與數據庫的連接;基于步驟6,創(chuàng )建消息模型的表;點(diǎn)擊添加按鈕,該應用程序將提交文本框的內容到的SQLite數據庫;點(diǎn)擊檢索按鈕,應用程序會(huì )獲取所有添加的消息,并在文本塊中顯示出來(lái)。
1.當在A(yíng)機安裝完Oracle數據庫后在B機安裝Oracle數據庫時(shí),一定要先將磁盤(pán)陣列D盤(pán)格式化,而不是只將D盤(pán)中已由A機安裝的Oracle數據庫刪除,否則可能會(huì )出現意想不到的錯誤,例如Oracle偵聽(tīng)服務(wù)失敗等; 2.最終安裝好Oracle數據庫后,要對D:\Oracle\Orant\network\Admin\ Listener。
ora文件進(jìn)行修改,其中Server名稱(chēng)一定要改為Active host name Alias,如不進(jìn)行修改將使客戶(hù)端的Oracle數據庫用戶(hù)無(wú)法連接到Oracle數據庫中。 3.在Hosts文件中增加一條記錄,使Active IP Address和Active Host Name相互對應,這樣系統就會(huì )自動(dòng)起到解析作用。
Hosts文件位于c:\Winnt\ system32\drivers\etc目錄下。 4.要注意不到萬(wàn)不得已,不要強行切換,避免產(chǎn)生數據錯誤。
如必須對雙機進(jìn)行切換,可先進(jìn)入Svrmgr Oracle服務(wù)器控制臺,用Shutdown命令關(guān)閉Oracle數據庫,再進(jìn)行切換。
1:Android SQLite數據庫創(chuàng )建數據庫 1。
Context。createDatabase(String name,int version , int mode,CursorFactory factory) 如果創(chuàng )建不成功則拋出FileNotFoundException異常 Java代碼 1。
SQLiteDatabase DataBase=this。openOrCreateDatabase ("DataBase。
db", 2。MODE_PRIVATE, 3。
new CursorFactory(){ 4。//創(chuàng )建新的數據庫,名稱(chēng)Database,模式MODE_PRIVATE 5。
public Cursor newCursor(SQLiteDatabase db, 6。SQLiteCursorDriver masterQuery, 7。
String editTable, 8。SQLiteQuery query){ 9。
return null; 10。} 11。
}); 12。SQLiteDatabase DataBase=this。
openOrCreateDatabase ("DataBase。db", 13。
MODE_PRIVATE, 14。new CursorFactory(){ 15。
//創(chuàng )建新的數據庫,名稱(chēng)Database,模式MODE_PRIVATE 16。public Cursor newCursor(SQLiteDatabase db, 17。
SQLiteCursorDriver masterQuery, 18。 String editTable, 19。
SQLiteQuery query){ 20。return null; 21。
} 22。}); 2:Android SQLite數據庫打開(kāi)已經(jīng)存在的數據庫。
[1]SQLite,是一款輕型的數據庫,是遵守ACID的關(guān)系型數據庫管理系統,它的設計目標是嵌入式的,而且目前已經(jīng)在很多嵌入式產(chǎn)品中使用了它,它占用資源非常的低,在嵌入式設備中,可能只需要幾百K的內存就夠了。
它能夠支持Windows/Linux/Unix等等主流的操作系統,同時(shí)能夠跟很多程序語(yǔ)言相結合,比如 Tcl、C#、PHP、Java等,還有ODBC接口,同樣比起Mysql、PostgreSQL這兩款開(kāi)源世界著(zhù)名的數據庫管理系統來(lái)講,它的處理速度比他們都快。 SQLite第一個(gè)Alpha版本誕生于2000年5月。
至今已經(jīng)有13個(gè)年頭,SQLite也迎來(lái)了一個(gè)版本 SQLite 3已經(jīng)發(fā)布。 目錄 1簡(jiǎn)介 2功能 3特性 4語(yǔ)言綁定 5類(lèi)型 6客戶(hù)端管理 7使用技巧 8SQLite 常用函數 9版本發(fā)布 10注意事項 1簡(jiǎn)介 編輯 SQLite是遵守ACID[2]的關(guān)系型數據庫管理系統,它包含在一個(gè)相對小的C庫中。
它是D。RichardHipp建立的公有領(lǐng)域項目。
[3] 不像常見(jiàn)的客戶(hù)-服務(wù)器范例,SQLite引擎不是個(gè)程序與之通信的獨立進(jìn)程,而是連接到程序中成為它的一個(gè)主要部分。所以主要的通信協(xié)議是在編程語(yǔ)言?xún)鹊闹苯覣PI調用。
這在消耗總量、延遲時(shí)間和整體簡(jiǎn)單性上有積極的作用。 整個(gè)數據庫(定義、表、索引和數據本身)都在宿主主機上存儲在一個(gè)單一的文件中。
它的簡(jiǎn)單的設計是通過(guò)在開(kāi)始一個(gè)事務(wù)的時(shí)候鎖定整個(gè)數據文件而完成的。[3] 2功能 編輯 SQLite雖然很小巧,但是支持的SQL語(yǔ)句不會(huì )遜色于其他開(kāi)源數據庫,它支持的SQL包括: ATTACH DATABASE BEGIN TRANSACTION comment COMMIT TRANSACTION COPY CREATE INDEX CREATE TABLE CREATE TRIGGER CREATE VIEW DELETE DETACH DATABASE DROP INDEX DROP TABLE DROP TRIGGER DROP VIEW END TRANSACTION EXPLAIN expression INSERT ON CONFLICT clause PRAGMA REPLACE ROLLBACK TRANSACTION SELECT UPDATE 同時(shí)它還支持事務(wù)處理功能等等。
也有人說(shuō)它象Microsoft的Access,有時(shí)候真的覺(jué)得有點(diǎn)象,但是事實(shí)上它們區別很大。比如SQLite 支持跨平臺,操作簡(jiǎn)單,能夠使用很多語(yǔ)言直接創(chuàng )建數據庫,而不象Access一樣需要Office的支持。
如果你是個(gè)很小型的應用,或者你想做嵌入式開(kāi)發(fā),沒(méi)有合適的數據庫系統,那么你可以考慮使用SQLite。 到2013年10月17日最新版本是 3。
8。1 。
它的官方網(wǎng)站是: 。cn,能在上面獲得源代碼和文檔。
同時(shí)因為數據庫結構簡(jiǎn)單,系統源代碼也不是很多,也適合想研究數據庫系統開(kāi)發(fā)的專(zhuān)業(yè)人士 3特性 編輯 1。 ACID事務(wù) 2。
零配置 – 無(wú)需安裝和管理配置 3。儲存在單一磁盤(pán)文件中的一個(gè)完整的數據庫 4。
數據庫文件可以在不同字節順序的機器間自由的共享 5。支持數據庫大小至2TB 6。
足夠小, 大致13萬(wàn)行C代碼, 4。43M 7。
比一些流行的數據庫在大部分普通數據庫操作要快 8。 簡(jiǎn)單, 輕松的API 9。
包含TCL綁定, 同時(shí)通過(guò)Wrapper支持其他語(yǔ)言的綁定 10。 良好注釋的源代碼, 并且有著(zhù)90%以上的測試覆蓋率 11。
獨立: 沒(méi)有額外依賴(lài) 12。 源碼完全的開(kāi)源, 你可以用于任何用途, 包括出售它 13。
支持多種開(kāi)發(fā)語(yǔ)言,C, PHP, Perl, Java, C#,Python, Ruby 4語(yǔ)言綁定 編輯 可以從C/C++程序中使用這個(gè)庫,還可以獲得對Tcl和一些其他腳本語(yǔ)言的綁定。 在CPAN的DBD::SQLite上有一個(gè)Perl的DBI/DBD模塊,它不是到SQLite的接口,而是包括整個(gè)SQLite數據庫引擎在其中并不需要任何額外的軟件。
還有一個(gè)Python模塊叫做PySQLite。 PHP從PHP5。
0開(kāi)始包含了SQLite,但是自5。 1版之后開(kāi)始成為一個(gè)延伸函式庫。
SQLite能與PHP4一起工作但不包含在其中。 Rails2。
0。3將缺省的數據庫配置改為了SQLite 3。
[3] 5類(lèi)型 編輯 SQLite的數據類(lèi)型 首先你會(huì )接觸到一個(gè)讓你驚訝的名詞: Typelessness(無(wú)類(lèi)型)。 對! SQLite是無(wú)類(lèi)型的。
這意味著(zhù)你可以保存任何類(lèi)型的數據到你所想要保存的任何表的任何列中, 無(wú)論這列聲明的數據類(lèi)型是什么(只有在一種情況下不是, 稍后解釋?zhuān)?對于SQLite來(lái)說(shuō)對字段不指定類(lèi)型是完全有效的。
如: Create Table ex1(a, b, c); 誠然SQLite允許忽略數據類(lèi)型, 但是仍然建議在你的Create Table語(yǔ)句中指定數據類(lèi)型。 因為數據類(lèi)型對于你和其他的程序員交流, 或者你準備換掉你的數據庫引擎時(shí)能起到一個(gè)提示或幫助的作用。
SQLite支持常見(jiàn)的數據類(lèi)型, 如: CREATE TABLE ex2 a VARCHAR(10), b NVARCHAR(15), c TEXT, d INTEGER, e FLOAT, f BOOLEAN, g CLOB, h BLOB, i TIMESTAMP, j NUMERIC(10,5) k VARYING CHARACTER (24), l NATIONAL VARYING CHARACTER(16) 前面提到在某種情況下, SQLite的字段并不是無(wú)類(lèi)型的。 即在字段類(lèi)型為”Integer Primary Key”時(shí)。
6客戶(hù)端管理 編輯 SQLite亦可以作為桌面數據庫使用,以下為第三方SQLite的GUI軟件。例如, SQLiteMan,使用QT開(kāi)發(fā)的一個(gè)SQLite客戶(hù)端,支持多語(yǔ)言、跨平臺。
SQLiteMan SQLite Manager, 以 火狐瀏覽器的擴展形式提供的SQLite客戶(hù)端。 SQLite Database Browser, a 。
Appropriate Uses For SQLite SQLite is different from most other SQL database engines in that its primary design goal is to be simple: Simple to administer Simple to operate Simple to embed in a larger program Simple to maintain and customize Many people like SQLite because it is small and fast。
But those qualities are just happy accidents。 Users also find that SQLite is very reliable。
Reliability is a consequence of simplicity。 With less complication, there is less to go wrong。
So, yes, SQLite is small, fast, and reliable, but first and foremost, SQLite strives to be simple。 Simplicity in a database engine can be either a strength or a weakness, depending on what you are trying to do。
In order to achieve simplicity, SQLite has had to sacrifice other characteristics that some people find useful, such as high concurrency, fine-grained access control, a rich set of built-in functions, stored procedures, esoteric SQL language features, XML and/or Java extensions, tera- or peta-byte scalability, and so forth。 If you need some of these features and do not mind the added complexity that they bring, then SQLite is probably not the database for you。
SQLite is not intended to be an enterprise database engine。 It is not designed to compete with Oracle or PostgreSQL。
The basic rule of thumb for when it is appropriate to use SQLite is this: Use SQLite in situations where simplicity of administration, implementation, and maintenance are more important than the countless complex features that enterprise database engines provide。 As it turns out, situations where simplicity is the better choice are more common than many people realize。
Another way to look at SQLite is this: SQLite is not designed to replace Oracle。 It is designed to replace fopen()。
Situations Where SQLite Works Well Application File Format SQLite has been used with great success as the on-disk file format for desktop applications such as financial analysis tools, CAD packages, record keeping programs, and so forth。 The traditional File/Open operation does an sqlite3_open() and executes a BEGIN TRANSACTION to get exclusive access to the content。
File/Save does a COMMIT followed by another BEGIN TRANSACTION。 The use of transactions guarantees that updates to the application file are atomic, durable, isolated, and consistent。
Temporary triggers can be added to the database to record all changes into a (temporary) undo/redo log table。 These changes can then be played back when the user presses the Undo and Redo buttons。
Using this technique, an unlimited depth undo/redo implementation can be written in surprisingly little code。 Embedded devices and applications Because an SQLite database requires little or no administration, SQLite is a good choice for devices or services that must work unattended and without human support。
SQLite is a good fit for use in cellphones, PDAs, set-top boxes, and/or appliances。 It also works well as an embedded database in downloadable consumer applications。
Websites SQLite usually will work great as the database engine for low to medium traffic websites (which is to say, 99。 9% of all websites)。
The amount of web traffic that SQLite can handle depends, of course, on how heavily the website uses its database。 Generally speaking, any site that gets fewer than 100K hits/day should work fine with SQLite。
The 100K hits/day figure is a conservative estimate, not a hard upper bound。 SQLite has been demonstrated to work with 10 times that amount of traffic。
Replacement for ad hoc disk files Many programs use fopen(), fread(), and fwrite() to create and manage files of data in home-grown formats。 SQLite works particularly well as a replacement for these ad hoc data files。
Internal or temporary databases For programs that have a lot of data that must be sifted and sorted in diverse ways, it is often easier and quicker to load the data into an in-memory SQLite database and use queries with joins and ORDER BY clauses to extract the data in the form and order needed rather than to try to code the same operations manually。 Using an SQL database internally in this way also gives the program greater flexibility since new columns and indices can be added without having to recode every query。
首先介紹我用Sqlite解決的實(shí)際問(wèn)題是什么? 問(wèn)題1:某個(gè)功能的數據需要連接一個(gè)遠程數據庫查詢(xún)速度很慢,查一次數據不容易,希望能夠重復利用之前查過(guò)的數據集。
問(wèn)題2:非常大的數據量比如幾千萬(wàn)甚至幾億條數據,一次性讀取到DataTable中,會(huì )內存溢出的,所以在第一次分析時(shí)就是通過(guò)Reader的方式,分析完一條后并不在內存中保存,但是緊接著(zhù)用戶(hù)的第二次分析、第三次分析還是要用到的第一次分析的數據,如果我們重新查詢(xún)一次遠程服務(wù)器,效率可想而知啊。 結合上面的2個(gè)問(wèn)題,為了解決效率問(wèn)題和數據重復利用度,減少數據庫服務(wù)器的壓力,我才用Sqlite緩存數據(當然這不是唯一也不是最好的解決方案) 。
優(yōu)化SQLiteHelper 陸兄的SQLiteHelper類(lèi)我增加了幾個(gè)有用的方法: 第一個(gè)方法是GetSchema,得到某個(gè)表的表結構。 ///
/// public DataTable GetSchema() { using (SQLiteConnection connection = new SQLiteConnection(connectionString)) { connection.Open(); DataTable data = connection.GetSchema("TABLES"); connection.Close(); //foreach (DataColumn column in data.Columns) //{ // Console.WriteLine(column.ColumnName); //} return data; } } 第二個(gè)方法是IsTableExist,判斷SQLite數據庫重某個(gè)表是否存在 。
///
/// 要創(chuàng )建的SQLite數據庫文件路徑 public bool IsTableExist(string tableName) { using (SQLiteConnection connection = new SQLiteConnection(connectionString)) { connection.Open(); using (SQLiteCommand command = new SQLiteCommand(connection)) { command.CommandText = "SELECT COUNT(*) FROM sqlite_master where type='table' and name='" + tableName + "'"; int iaaa = Convert.ToInt32(command.ExecuteScalar()); if (Convert.ToInt32(command.ExecuteScalar()) == 0) { return false; } else { return true; } } } } 第三個(gè)方法是Query,執行查詢(xún)語(yǔ)句,返回DataSet ///
/// 查詢(xún)語(yǔ)句 /// DataSet public DataSet Query(string SQLString) { using (SQLiteConnection connection = new SQLiteConnection(connectionString)) { DataSet ds = new DataSet(); try { connection.Open(); SQLiteDataAdapter command = new SQLiteDataAdapter(SQLString, connection); command.Fill(ds, "ds"); } catch (System.Data.SQLite.SQLiteException ex) { throw new Exception(ex.Message); } return ds; } } 構建緩存對象模型和緩存控制器 每一塊緩存對象,在數據庫中會(huì )產(chǎn)生一個(gè)表,而表名稱(chēng)是有緩存控制器自動(dòng)生成的,訪(fǎng)問(wèn)緩存的工作全部交由緩存控制器完成,通過(guò)緩存項的ID和ModuleKey來(lái)訪(fǎng)問(wèn)。 在Sqlite中還需要一個(gè)系統表來(lái)維護每個(gè)緩存項和實(shí)際緩存存儲表之間的對應關(guān)系,我們稱(chēng)之為配置表,它將在緩存控制器創(chuàng )建Sqlite緩存數據庫文件時(shí)創(chuàng )建。
配置表共有以下幾個(gè)字段,分別和緩存對象模型CdlCacheItem類(lèi)映射: 列名稱(chēng) 說(shuō)明 Id 緩存的唯一數字編號 ModuleKey 緩存模塊名稱(chēng),一個(gè)模塊可以有多個(gè)緩存數據,ID可以區分。實(shí)際應用時(shí),某個(gè)功能時(shí)會(huì )經(jīng)常緩存數據的,所以通過(guò)ModuleKey就可以得到這個(gè)功能所有的緩存列表,然后選定其中的部分緩存來(lái)進(jìn)行使用。
Comments 緩存說(shuō)明 TableName 緩存數據存儲的數據表名稱(chēng) AddDate 緩存時(shí)間戳 創(chuàng )建數據庫的方法如下: static void CreateDB() { //總共有ID、ModuleKey、Comments、AddDate這幾列 string sql = "CREATE TABLE SYSCDLTABLES(ID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE,MODULEKEY VARCHAR(200),COMMENTS VARCHAR(500),TABLENAME VARCHAR(100),ADDDATE DATETIME)"; SQLiteDBHelper.CreateDB(CACHEFILEPATH, sql); } 每個(gè)緩存項(緩存對象模型)定義如下,和配置表對應: ///
/// Tecky Lee /// 2011-1-11 15:11 public class CdlCacheItem { int m_id; public int Id { get { return m_id; } set { m_id = value; } } string m_moduleKey; public string ModuleKey { get { return m_moduleKey; } set { m_moduleKey = value; } } string m_comments; public string Comments { get { return m_comments; } set { m_comments = value; } } string m_tableName; public string TableName { get { return m_tableName; } set { m_tableName = value; } } DateTime m_timestamp; public DateTime Timestamp { get { return m_timestamp; } set { m_timestamp = value; } } } 下面是控制器的接口定義: public interface ICdlCacheController { void BeginLoadRow(); void EndLoadRow(); System.Collections。.。
內存溢出導致程序崩潰,也分是java層崩了,還是mysql崩了。
如果是java層崩了,注意不要一次性加載太多的數據到內存,并且不在使用的數據要徹底放棄引用關(guān)系。java雖然是自動(dòng)回收,回收的原則就是一個(gè)對象不再被持有,即引用計數為零。
如果數據太大,可考慮臨時(shí)文件。如果是mysql崩了,首先增加配置緩存。
一般來(lái)說(shuō)mysql是不容易崩的,特別是插入操作的時(shí)候。查詢(xún)的時(shí)候如果查詢(xún)結果記錄集特別大,會(huì )導致一個(gè)查詢(xún)需要使用很大的內存空間,這種是有問(wèn)題的。
而插入操作都是一條一條的執行,不會(huì )導致大內存的使用。如果僅僅是數據移植,也盡量不要用ORM框架,比如hibernate,mybatis這些東西,因為他們都有自己的緩存,直接使用JDBC比較好。
聲明:本網(wǎng)站尊重并保護知識產(chǎn)權,根據《信息網(wǎng)絡(luò )傳播權保護條例》,如果我們轉載的作品侵犯了您的權利,請在一個(gè)月內通知我們,我們會(huì )及時(shí)刪除。
蜀ICP備2020033479號-4 Copyright ? 2016 學(xué)習?shū)B(niǎo). 頁(yè)面生成時(shí)間:2.789秒