1. 哪位成功編譯了使用了sqlite3的android代碼,能分享下方法嗎
1、你在sqlite3建好庫後放在assets資源文件下或者自定義文件下,拷貝到你自定義的路徑然後打開,代碼如下:
(1)private void File() {
LogUtils.i("考唄");
//判斷資料庫是否拷貝到相應的目錄下
if (new File(fileName).exists() == false) {//判斷是否存在此文件
File dir = new File(DB_PATH);//不存在則創建文件
if (!dir.exists()) {
dir.mkdir();
}
//復制文件
try {
InputStream is = this.getBaseContext().getAssets().open(DB_NAME);//要拷貝的文件在assets下
// InputStream is=this.getResources().openRawResource(
// R.raw.question);//要拷貝的文件在raw文件夾下
OutputStream os = new FileOutputStream(fileName);
LogUtils.i("拷貝成功");
//用來復制文件
byte[] buffer = new byte[8192];
//保存已經復制的長度
int length;
//開始復制
while ((length = is.read(buffer)) > 0) {
os.write(buffer, 0, length);
}
//刷新
os.flush();
//關閉
os.close();
is.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
(2)打開方法,成功打開後即可操作表(真機運行需root許可權,虛擬機正常)
private SQLiteDatabase db;
db = SQLiteDatabase.openDatabase("fileName/xxx.db", null, SQLiteDatabase.OPEN_READWRITE);
2. 如何查看android 手機上sqlite3資料庫
Android是有自帶的類庫的:SQLiteOpenHelper,使用的時候繼承這個類,然後寫邏輯就可以,一般使用單例模式:
public synchronized static DBHelper getDBHelper(Context context) {
if (helper == null) {
helper = new DBHelper(context);
}
return helper;
}
private DBHelper(Context context) {
super(context, "自己的資料庫名", null, 資料庫版本);
}
使用的時候也很簡單,下面是一個刪除操作:
public synchronized void deleteSite(String packname) {
SQLiteDatabase db = getWritableDatabase();
try {
db.beginTransaction();
db.delete("site", "packname=?", new String[] { packname });
db.setTransactionSuccessful();
} finally {
db.endTransaction();
if (db != null) {
}
}
}
3. 安卓怎麼讀取sqlite資料庫
安裝SQLite Expert Professional 可以在網上下載,我下載的是試用版,沒有找注冊碼,但是試用不影響使用,反正用幾次查看到資料庫操作沒有錯誤就不用這個工具了。當然也可以使用Eclipse插件DDMS來查看,也可以使用Android工具包中的adb工具來查看。android項目中的sqlite資料庫位於/data/data/項目包/databases中。先介紹使用DDMS導出sqlite資料庫的操作和使用adb工具訪問sqlite資料庫。
首先打開android項目的調試模式,然後找到顯示DDMS
切換到DDMS,顯示File Explorer窗口,找到/data/data/ 如下圖1 ,
然後找到程序包的文件夾,打開databases,就能看到sqlite資料庫文件了。選擇將其導出。如下圖2.
這樣就把sqlite資料庫文件以文件的方式導出來了,然後使用sqlite界面管理工具如SQLite Expert Professional可以打開該資料庫了。其他 sqlite界面管理工具如sqlite administrator、sqlite man或者firefox插件sqlite manager也可以打開該資料庫。
使用adb工具訪問sqlite資料庫
Android Debug Bridge(ADB)是Android的一個通用調試工具,它可以更新設備或模擬器中的代碼,可以管理預定埠,可以在設備上運行shell命令,我們 知道android是基於linux內核,它的內部文件結構也是採用linux文件組織方式,因此訪問它的文件結構需要使用shell。這次我們就會用 shell來訪問android應用中的sqlite資料庫文件。
1、運行cmd,切換到android-sdk目錄,運行adb.exe,加上參數shell,出現#號就代表進入了shell命令模式,注意adb要在Android模擬器運行時才能進入shell:如下圖
進入資料庫所在目錄:
shell命令記住兩個基本命令ls和cd,類似windows命令提示行中的dir和cd,代表列出當前目錄下文件列表和進入到指定目錄。了解這兩個命令之後,就可以找到data/data/項目包名/databases 如下圖1, 找到資料庫文件如下圖2。
使用sqlite管理工具來進行資料庫操作
鍵入sqlite3 資料庫名就進入了sqlite管理模式了。
如下圖
設置sqlite環境變數:
在android的sdk中自帶了sqlite3.exe,這是sqlite的官方管理工具,它是一個命令行工具。為了使用方便,將其路徑注冊到系 統環境變數path中,即將;%Android_Home%加在Path中,這樣只樣運行sqlite3,就能直接打開sqlite管理工具了。
如下圖:
8
使用sqlite管理資料庫:
sqlite命令行工具默認是以;結束語句的。所以如果只是一行語句,要在末尾加;,或者在下一行中鍵入;,這樣sqlite命令才會被執行。
sqlite常用命令:
.tables--查看資料庫的表列表
.exit--退出sqlite命令行
其他命令可隨時.help查看幫助。sql命令可直接在此命令行上執行即可:
4. 如何打開android的sqlite3
配置環境變數即可打開sqlite3
工具/原料
eclipse
jdk
android sdk
方法/步驟
首先將sdk ools目錄下的sqlite3拷貝一份到sdkplatform-tools
然後打開環境變數 然後新建一個android的變數名和sdk所在目錄下的platform-tools文件夾目錄打進去 然後打上;號
5. 誰能給我發一個安卓帶有SQLite資料庫連接的能跑起來的小程序啊萬分感謝。
Sqlite3是android自帶的一種輕型的資料庫,使用的話也是很方便的。 下面是例子: package yeshu.sqlite3; import android.app.Activity; import android.content.ContentValues; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.EditText; public class sqlite3 extends Activity { private Button createdatabase; private Button updatedatabase; private Button insert; private Button update; private Button select; private Button delete; private EditText edittext01; private EditText edittext02; private String name; private int id; private String dbname; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); createdatabase = (Button) findViewById(R.id.xxx); updatedatabase = (Button)findViewById(R.id.Button02); insert = (Button)findViewById(R.id.Button03); update = (Button)findViewById(R.id.Button04); select = (Button)findViewById(R.id.Button05); delete = (Button)findViewById(R.id.Button06); edittext01 = (EditText)findViewById(R.id.EditText01); edittext02 = (EditText)findViewById(R.id.EditText02); createdatabase.setOnClickListener(new OnClickListener_create()); updatedatabase.setOnClickListener(new OnClickListener_updatedatabase()); insert.setOnClickListener(new OnClickListener_insert()); update.setOnClickListener(new OnClickListener_update()); select.setOnClickListener(new OnClickListener_select()); delete.setOnClickListener(new OnClickListener_delete()); } class OnClickListener_delete implements OnClickListener { public void onClick(View v) { // TODO Auto-generated method stub id = Integer.parseInt(edittext01.getText().toString()); Data temp = new Data(sqlite3.this, "data_yeshu"); SQLiteDatabase db = temp.getWritableDatabase(); db.delete("user", "id=?", new String[]{id+""}); } } class OnClickListener_insert implements OnClickListener { public void onClick(View v) { // TODO Auto-generated method stub name = edittext02.getText().toString(); id = Integer.parseInt(edittext01.getText().toString()); Data temp = new Data(sqlite3.this, "data_yeshu"); SQLiteDatabase db = temp.getWritableDatabase(); ContentValues value = new ContentValues(); value.put("id", id); value.put("name", name); db.insert("user", null, value); System.out.println("insert"); } } class OnClickListener_update implements OnClickListener { public void onClick(View v) { // TODO Auto-generated method stub name = edittext02.getText().toString(); id = Integer.parseInt(edittext01.getText().toString()); Data temp = new Data(sqlite3.this, "data_yeshu"); SQLiteDatabase db = temp.getWritableDatabase(); ContentValues value = new ContentValues(); value.put("name", name); db.update("user", value, "id=?", new String[]{id+""}); } } class OnClickListener_updatedatabase implements OnClickListener { public void onClick(View v) { // TODO Auto-generated method stub Data temp = new Data(sqlite3.this, "data_yeshu", 2); SQLiteDatabase db = temp.getReadableDatabase(); } } class OnClickListener_select implements OnClickListener { public void onClick(View v) { // TODO Auto-generated method stub Data temp = new Data(sqlite3.this, "data_yeshu"); SQLiteDatabase db = temp.getReadableDatabase(); Cursor cursor = db.query("user", new String[]{"id", "name"}, "id=?", new String[]{"1"}, null, null, null); while(cursor.moveToNext()) { System.out.println(cursor.getShort(cursor.getColumnIndex("id"))); System.out.println(cursor.getString(cursor.getColumnIndex("name"))); } } } class OnClickListener_create implements OnClickListener { public void onClick(View v) { // TODO Auto-generated method stub Data temp = new Data(sqlite3.this, "data_yeshu"); SQLiteDatabase db = temp.getReadableDatabase(); } } } ================================ package yeshu.sqlite3; import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteDatabase.CursorFactory; import android.database.sqlite.SQLiteOpenHelper; public class Data extends SQLiteOpenHelper { private static final int VERSION = 1; public Data(Context context, String name, CursorFactory factory, int version) { super(context, name, factory, version); // TODO Auto-generated constructor stub } public Data(Context context, String name, int version) { this(context, name, null, version); } public Data(Context context , String name) { this(context, name, null, VERSION); } @Override public void onCreate(SQLiteDatabase db) { // TODO Auto-generated method stub System.out.println("create a new database"); db.execSQL("create table user(id int, name VERCHAR(20))"); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { // TODO Auto-generated method stub System.out.println("update a database"); } }
6. android 5.0.1 資料庫sqlite3怎麼導入
1、運行輸入
adb
shell
(前提是模擬器正在運行)。
2、進入命令界面後
輸入
ls
指令
會列出文件的目錄。
3、cd
進入你想要的目錄里。
4、一層一層進去後會發現
databases目錄
你的數據文件就在這個目錄下放著。
5、sqlite3
test
(test就是你創建的資料庫的名稱
注意:不要加.db
後綴)。
6、現在你就進入你創建的test資料庫了使用
.tables
就可以查看所有的表了。
7. 如何使用SQLite,Android上SQLite的最佳實踐
SQLite3是目前最新的SQLite版本。可以從網站上下載SQLite3的源代碼(本書使用的版本是sqlite-3.6.12.tar.gz)。
解壓縮後進入sqlite-3.6.12的根目錄,首先命令「./configure」生成Makefile文件,接著運行命令「make」對源代碼進行編譯,最後運行命令「make install」安裝SQLite3。安裝完畢後,可以運行命令sqlite3查看SQLite3是否能正常運行,如下所示:
[root@localhost ~]# sqlite3
SQLite version 3.6.12
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite>
可以看到,SQLite3啟動後會停留在提示符sqlite>處,等待用戶輸入SQL語句。
在使用SQLite3前需要先了解下SQLite3支持的數據類型。SQLite3支持的基本數據類型主要有以下幾類:
NULL
NUMERIC
INTEGER
REAL
TEXT
SQLite3會自動把其他數據類型轉換成以上5類基本數據類型,轉換規則如下所示:
char、clob、test、varchar—> TEXT
integer—>INTEGER
real、double、float—> REAL
blob—>NULL
其餘數據類型都轉變成NUMERIC
下面通過一個實例來演示SQLite3的使用方法。
新建一個資料庫
新建資料庫test.db(使用.db後綴是為了標識資料庫文件)。在test.db中新建一個表test_table,該表具有name,、sex、age三列。SQLite3的具體操作如下所示:
[root@localhost home]# sqlite3 test.db
SQLite version 3.6.12
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> create table test_table(name, sex, age);
如果資料庫test.db已經存在,則命令「sqlite3 test.db」會在當前目錄下打開test.db。如果資料庫test.db不存在,則命令「sqlite3 test.db」會在當前目錄下新建資料庫test.db。為了提高效率,SQLite3並不會馬上創建test.db,而是等到第一個表創建完成後才會在物理上創建資料庫。
由於SQLite3能根據插入數據的實際類型動態改變列的類型,所以在create語句中並不要求給出列的類型。
創建索引
為了加快表的查詢速度,往往在主鍵上添加索引。如下所示的是在name列上添加索引的過程。
sqlite> create index test_index on test_table(name);
操作數據
如下所示的是在test_table中進行數據的插入、更新、刪除操作:
sqlite> insert into test_table values ('xiaoming', 'male', 20);
sqlite> insert into test_table values ('xiaohong', 'female', 18);
sqlite> select * from test_table;
xiaoming|male|20
xiaohong|female|18
sqlite> update test_table set age=19 where name = 'xiaohong';
sqlite> select * from test_table;
xiaoming|male|20
xiaohong|female|19
sqlite> delete from test_table where name = 'xiaoming';
sqlite> select * from test_table;
xiaohong|female|19
批量操作資料庫
如下所示的是在test_table中連續插入兩條記錄:
sqlite> begin;
sqlite> insert into test_table values ('xiaoxue', 'female', 18);
sqlite> insert into test_table values ('xiaoliu', 'male', 20);
sqlite> commit;
sqlite> select * from test_table;
xiaohong|female|19
xiaoxue|male|18
xiaoliu|male|20
運行命令commit後,才會把插入的數據寫入資料庫中。
資料庫的導入導出
如下所示的是把test.db導出到sql文件中:
[root@localhost home]# sqlite3 test.db ".mp" > test.sql;
test.sql文件的內容如下所示:
BEGIN TRANSACTION;
CREATE TABLE test_table(name, sex, age);
INSERT INTO "test_table" VALUES('xiaohong','female',19);
CREATE INDEX test_index on test_table(name);
COMMIT;
如下所示的是導入test.sql文件(導入前刪除原有的test.db):
[root@localhost home]# sqlite3 test.db < test.sql;
通過對test.sql文件的導入導出,可以實現資料庫文件的備份。
11.2.2 SQLite3的C介面
以上介紹的是SQLite3資料庫的命令操作方式。在實際使用中,一般都是應用程序需要對資料庫進行訪問。為此,SQLite3提供了各種編程語言的使用介面(本書介紹C語言介面)。SQLite3具有幾十個C介面,下面介紹一些常用的C介面。
sqlite_open
作用:打開SQLite3資料庫
原型:int sqlite3_open(const char *dbname, sqlite3 **db)
參數:
dbname:資料庫的名稱;
db:資料庫的句柄;
sqlite_colse
作用:關閉SQLite3資料庫
原型:int sqlite_close(sqlite3 *db)
例如:
test.c:
#include <stdio.h>
#include <sqlite3.h>
static sqlite3 *db=NULL;
int main()
{
int rc;
rc= sqlite3_open("test.db", &db);
if(rc)
{
printf("can't open database!\n");
}
else
{
printf("open database success!\n");
}
sqlite3_close(db);
return 0;
}
運行命令「gcc –o test test.c –lsqlite3」進行編譯,運行test的結果如下所示:
[root@localhost home]# open database success!
sqlite_exec
作用:執行SQL語句
原型:int sqlite3_exec(sqlite3 *db, const char *sql, int (*callback)(void*,int,char**,char**), void *, char **errmsg)
參數:
db:資料庫;
sql:SQL語句;
callback:回滾;
errmsg:錯誤信息
例如:
test.c:
#include <stdio.h>
#include <sqlite3.h>
static sqlite3 *db=NULL;
static char *errmsg=NULL;
int main()
{
int rc;
rc = sqlite3_open("test.db", &db);
rc = sqlite3_exec(db,"insert into test_table values('bao', 'male', 24)", 0, 0, &errmsg);
if(rc)
{
printf("exec fail!\n");
}
else
{
printf("exec success!\n");
}
sqlite3_close(db);
return 0;
}
編譯完成後,運行test的結果如下所示:
[root@localhost home]# ./test
exec success!
[root@localhost home]# sqlite3 test.db
SQLite version 3.6.11
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> select * from test_table;
bao|male|24
sqlite3_get_table
作用:執行SQL查詢
原型:int sqlite3_get_table(sqlite3 *db, const char *zSql, char ***pazResult, int *pnRow, int *pnColumn, char **pzErrmsg)
參數:
db:資料庫;
zSql:SQL語句;
pazResult:查詢結果集;
pnRow:結果集的行數;
pnColumn:結果集的列數;
errmsg:錯誤信息;
sqlite3_free_table
作用:注銷結果集
原型:void sqlite3_free_table(char **result)
參數:
result:結果集;
例如:
test.c:
#include <stdio.h>
#include <sqlite3.h>
static sqlite3 *db=NULL;
static char **Result=NULL;
static char *errmsg=NULL;
int main()
{
int rc, i, j;
int nrow;
int ncolumn;
rc= sqlite3_open("test.db", &db);
rc= sqlite3_get_table(db, "select * from test_table", &Result, &nrow, &ncolumn,
&errmsg);
if(rc)
{
printf("query fail!\n");
}
else
{
printf("query success!\n");
for(i = 1; i <= nrow; i++)
{
for(j = 0; j < ncolumn; j++)
{
printf("%s | ", Result[i * ncolumn + j]);
}
printf("\n");
}
}
sqlite3_free_table(Result);
sqlite3_close(db);
return 0;
}
編譯完成後,運行test的結果如下所示:
[root@localhost home]# ./test
query success!
xiaohong | female | 19 |
xiaoxue | female | 18 |
xiaoliu | male | 20 |
bao | male | 24 |
sqlite3_prepare
作用:把SQL語句編譯成位元組碼,由後面的執行函數去執行
原型:int sqlite3_prepare(sqlite3 *db, const char *zSql, int nByte, sqlite3_stmt **stmt, const char **pTail)
參數:
db:資料庫;
zSql:SQL語句;
nByte:SQL語句的最大位元組數;
stmt:Statement句柄;
pTail:SQL語句無用部分的指針;
sqlite3_step
作用:步步執行SQL語句位元組碼
原型:int sqlite3_step (sqlite3_stmt *)
例如:
test.c:
#include <stdio.h>
#include <sqlite3.h>
static sqlite3 *db=NULL;
static sqlite3_stmt *stmt=NULL;
int main()
{
int rc, i, j;
int ncolumn;
rc= sqlite3_open("test.db", &db);
rc=sqlite3_prepare(db,"select * from test_table",-1,&stmt,0);
if(rc)
{
printf("query fail!\n");
}
else
{
printf("query success!\n");
rc=sqlite3_step(stmt);
ncolumn=sqlite3_column_count(stmt);
while(rc==SQLITE_ROW)
{
for(i=0; i<2; i++)
{
printf("%s | ", sqlite3_column_text(stmt,i));
}
printf("\n");
rc=sqlite3_step(stmt);
}
}
sqlite3_finalize(stmt);
sqlite3_close(db);
return 0;
}
編譯完成後,運行test的結果如下所示:
[root@localhost home]# ./test
query success!
xiaohong | female | 19 |
xiaoxue | female | 18 |
xiaoliu | male | 20 |
bao | male | 24 |
在程序中訪問SQLite3資料庫時,要注意C API的介面定義和數據類型是否正確,否則會得到錯誤的訪問結果。
8. sqlite android
1。你可以通過在console里直接用命令select,這個需要你的工具里有sqlite(或者更高的版本sqlite3)
2。也可以寫個小AP,通過代碼再在你的控制項里show出來
3。把資料庫導出來直接在你的桌面系統上看
9. 如何將SQLite3 創建的資料庫與android 程序連接
Sqlite3是android自帶的一種輕型的資料庫,使用的話也是很方便的。
下面是例子:
package yeshu.sqlite3;
import android.app.Activity;
import android.content.ContentValues;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
public class sqlite3 extends Activity {
private Button createdatabase;
private Button updatedatabase;
private Button insert;
private Button update;
private Button select;
private Button delete;
private EditText edittext01;
private EditText edittext02;
private String name;
private int id;
private String dbname;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
createdatabase = (Button) findViewById(R.id.xxx);
updatedatabase = (Button)findViewById(R.id.Button02);
insert = (Button)findViewById(R.id.Button03);
update = (Button)findViewById(R.id.Button04);
select = (Button)findViewById(R.id.Button05);
delete = (Button)findViewById(R.id.Button06);
edittext01 = (EditText)findViewById(R.id.EditText01);
edittext02 = (EditText)findViewById(R.id.EditText02);
createdatabase.setOnClickListener(new OnClickListener_create());
updatedatabase.setOnClickListener(new OnClickListener_updatedatabase());
insert.setOnClickListener(new OnClickListener_insert());
update.setOnClickListener(new OnClickListener_update());
select.setOnClickListener(new OnClickListener_select());
delete.setOnClickListener(new OnClickListener_delete());
}
class OnClickListener_delete implements OnClickListener
{
public void onClick(View v) {
// TODO Auto-generated method stub
id = Integer.parseInt(edittext01.getText().toString());
Data temp = new Data(sqlite3.this, "data_yeshu");
SQLiteDatabase db = temp.getWritableDatabase();
db.delete("user", "id=?", new String[]{id+""});
}
}
class OnClickListener_insert implements OnClickListener
{
public void onClick(View v) {
// TODO Auto-generated method stub
name = edittext02.getText().toString();
id = Integer.parseInt(edittext01.getText().toString());
Data temp = new Data(sqlite3.this, "data_yeshu");
SQLiteDatabase db = temp.getWritableDatabase();
ContentValues value = new ContentValues();
value.put("id", id);
value.put("name", name);
db.insert("user", null, value);
System.out.println("insert");
}
}
class OnClickListener_update implements OnClickListener
{
public void onClick(View v) {
// TODO Auto-generated method stub
name = edittext02.getText().toString();
id = Integer.parseInt(edittext01.getText().toString());
Data temp = new Data(sqlite3.this, "data_yeshu");
SQLiteDatabase db = temp.getWritableDatabase();
ContentValues value = new ContentValues();
value.put("name", name);
db.update("user", value, "id=?", new String[]{id+""});
}
}
class OnClickListener_updatedatabase implements OnClickListener
{
public void onClick(View v) {
// TODO Auto-generated method stub
Data temp = new Data(sqlite3.this, "data_yeshu", 2);
SQLiteDatabase db = temp.getReadableDatabase();
}
}
class OnClickListener_select implements OnClickListener
{
public void onClick(View v) {
// TODO Auto-generated method stub
Data temp = new Data(sqlite3.this, "data_yeshu");
SQLiteDatabase db = temp.getReadableDatabase();
Cursor cursor = db.query("user", new String[]{"id", "name"}, "id=?", new String[]{"1"}, null, null, null);
while(cursor.moveToNext())
{
System.out.println(cursor.getShort(cursor.getColumnIndex("id")));
System.out.println(cursor.getString(cursor.getColumnIndex("name")));
}
}
}
class OnClickListener_create implements OnClickListener
{
public void onClick(View v) {
// TODO Auto-generated method stub
Data temp = new Data(sqlite3.this, "data_yeshu");
SQLiteDatabase db = temp.getReadableDatabase();
}
}
}
================================
package yeshu.sqlite3;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;
public class Data extends SQLiteOpenHelper {
private static final int VERSION = 1;
public Data(Context context, String name, CursorFactory factory,
int version) {
super(context, name, factory, version);
// TODO Auto-generated constructor stub
}
public Data(Context context, String name, int version)
{
this(context, name, null, version);
}
public Data(Context context , String name)
{
this(context, name, null, VERSION);
}
@Override
public void onCreate(SQLiteDatabase db) {
// TODO Auto-generated method stub
System.out.println("create a new database");
db.execSQL("create table user(id int, name VERCHAR(20))");
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
// TODO Auto-generated method stub
System.out.println("update a database");
}
}