 |
Android - พี่ๆ ท่านใด เคยใช้ฐานข้อมูล SQLite 2009 Pro Enterprise Manager บ้างคะ รบกวนแนะนำหน่อย |
|
 |
|
|
 |
 |
|
[u]Features:[/u]
* Encryption Method is now compatible with wxSQLite3 (AES-128 bits) and SQLite3 ADO.NET Provider (RSA-MS Crypt)
* Syntax Highlight
* Hex Viewer
* Dump database to SQL file format
* Unicode Support
* Blob/Image viewer
* Built-in FTS3 Extention
* Built-in LUA Programming Language
* Encrypted database support
* Export recordset into excel, csv, xml and html format
* Import data from Ms Access / MS SQL server
* Includes SQLite2009 Pro ODBC Driver
* Includes Additional sqlite3 function (compress, decompress, crc32, md5, lua_exec, etc)
* Transactions supported
* Visual Query Builder
* Includes the user-contributed extension-functions from homepage
The new functions are: acos, asin, atan, atn2, atan2, acosh, asinh, atanh, difference, degrees, radians, cos, sin, tan, cot, cosh, sinh, tanh, coth, exp, log, log10, power, sign, sqrt, square, ceil, floor, pi, replicate, charindex, leftstr, rightstr, reverse, proper, padl, padr, padc, strfilter, and aggregates stdev, variance, mode, median, lower_quartile, upper_quartile.
มันทำอะไรได้ดีกว่าเดิม แต่อันที่จริงบน Android ใช้แค่ SQLite ก็พอครับ
|
 |
 |
 |
 |
Date :
2013-09-25 06:17:10 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
private static final int DATABASE_VERSION = 1;
// Database Name
private static final String DATABASE_NAME = "mydatabase";
// Table Name
private static final String TABLE_MEMBER = "members";
public myDBClass(Context context) {
super(context, DATABASE_NAME, null, DATABASE_VERSION);
// TODO Auto-generated constructor stub
}
@Override
public void onCreate(SQLiteDatabase db) {
// TODO Auto-generated method stub
// Create Table Name
db.execSQL("CREATE TABLE " + TABLE_MEMBER +
"(MemberID INTEGER PRIMARY KEY AUTOINCREMENT," +
" Name TEXT(100)," +
" Tel TEXT(100));");
Log.d("CREATE TABLE","Create Table Successfully.");
}
// Select Data
public String[] SelectData(String strMemberID) {
// TODO Auto-generated method stub
try {
String arrData[] = null;
SQLiteDatabase db;
db = this.getReadableDatabase(); // Read Data
Cursor cursor = db.query(TABLE_MEMBER, new String[] { "*" },
"MemberID=?",
new String[] { String.valueOf(strMemberID) }, null, null, null, null);
if(cursor != null)
{
if (cursor.moveToFirst()) {
arrData = new String[cursor.getColumnCount()];
/***
* 0 = MemberID
* 1 = Name
* 2 = Tel
*/
arrData[0] = cursor.getString(0);
arrData[1] = cursor.getString(1);
arrData[2] = cursor.getString(2);
}
}
cursor.close();
db.close();
return arrData;
} catch (Exception e) {
return null;
}
}
// Show All Data
public ArrayList<HashMap<String, String>> SelectAllData() {
// TODO Auto-generated method stub
try {
ArrayList<HashMap<String, String>> MyArrList = new ArrayList<HashMap<String, String>>();
HashMap<String, String> map;
SQLiteDatabase db;
db = this.getReadableDatabase(); // Read Data
String strSQL = "SELECT * FROM " + TABLE_MEMBER;
Cursor cursor = db.rawQuery(strSQL, null);
if(cursor != null)
{
if (cursor.moveToFirst()) {
do {
map = new HashMap<String, String>();
map.put("MemberID", cursor.getString(0));
map.put("Name", cursor.getString(1));
map.put("Tel", cursor.getString(2));
MyArrList.add(map);
} while (cursor.moveToNext());
}
}
cursor.close();
db.close();
return MyArrList;
} catch (Exception e) {
return null;
}
}
มันเขียนโค้ด แตกต่างจาก SQLite อย่างไร อะคะ
เพ่ TC Admin
|
 |
 |
 |
 |
Date :
2013-09-25 08:49:16 |
By :
Amporn_Aom |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|