sqlite´æmp3
Step-1: Ê×ÏÈ將.mp3檔°¸·ÅÈëProjectµÄ/res/raw/裡£¬ÈçÏ£º
³Ìʽһ開ʼ執ÐУ¬½¨Á¢Ò»個資ÁÏ庫£¬º¬ÓÐBLOB欄룬ÈçÏÂÖ®Ö¸Á
sql = "create table mySong("
+ "song_no text not null, "
+ "song_mp3 blob );";
try {
db.execSQL(sql);
} catch (SQLException e) {
Log.e("ERROR", e.toString());
return;
}
Step-2: 從ProjectµÄ/res/raw/讀È¡*.mp3¸èÇú£¬È»áá·Ö¶Î儲´æµ½SQLiteµÄBLOB裡£¬ÈçÏÂÖ®Ö¸Á
InputStream is = getResources().openRawResource(rid);
int bufSize = 63*1024;
byte[] buffer = new byte[bufSize];
try {
int size = is.read(buffer);
while(size >= 0){
ByteArrayOutputStream out = new ByteArrayOutputStream(size);
out.write(buffer, 0, size);
out.flush();
out.close();
cv.put("song_mp3", out.toByteArray());
db.insert("mySong", null, cv);
size = is
Ïà¹ØÎĵµ£º
½ñÌìºÜ×ÔÈ»µÄÔÚдSqlÓï¾äµÄʱºòÓÃÁËTop£¬Ò»¿ªÊ¼Ã»·¢ÏÖÎÊÌ⣬ÒòΪÎÒ´ÓÊý¾Ý¿â¶Á³öµÄÖµÕýºÃÊÇ0£¬¶øÎÒÏ°¹ß±äÁ¿¶¨ÒåµÄʱºòÒ²¶¼¸³Öµ0£¬¿ÉÊǵ½ÎÒ²»Òª0µÄʱºòÎҾͷ¢ÏÖÎÊÌâÁË¡£ºóÀ´²ÅÖªµÀ£¬¿É°®µÄСsqlite¾¹È»Óв»Ö§³ÖµÄsqlÓï·¨¡£
¡¡¡¡¿´µ½Ä³¸öÂÛ̳ÓиöÐÂÊÖÒ²·¢ÏÖÁËÕâ¸öÎÊÌâ²¢·¢ÌûÁË£¬ÏÂÃæһţÈ˵Ļظ´ÊÇ“topÊÇÄļҵĹؼü´Ê?s ......
½ñÌìÓöµ½ÁËÂé·³£º
ÓÃEclipse±àÒëpythonÏòsqliteÊý¾Ý¿â²åÈëÊý¾Ý×ÜÊÇÌáʾ±àÂëµÄÎÊÌ⣬ÎÒÉèÖÃÁËEclipseµÄworkspaceÓÃutf-8±àÂ뻹ÊDz»ÐÐ
µ«ÊÇÓÃEclipseдµÄ³ÌÐò±£´æÔÙÓÃIDLE´ò¿ªÈ´ÄܱàÒ룬Ææ¹ÖÁË
ÎÒ¿¼Âǵ½¿ÉÄÜÊÇÅäÖõÄÔÒò£¬ÕÒÕÒ±éÁËËùÓеÄÅäÖ㬶¼Ã»ÓÐÎÊÌ⣬°üÀ¨¹¤³ÌÎļþ
×îºóÎÒÓÃxvi32´ò¿ ......
ÔÚSQLite on BlackBerryÉÏ£¬JDBC·ÃÎÊÊý¾Ý¿â£¬È±Ê¡ÊÇÒÔUTF-8±£´æÊý¾Ýµ½Êý¾Ý¿âÀïÃæµÄ£¬Ã¿¸öÖÐÎÄͨ³£ÊÇ3¸ö×Ö½Ú±£´æµ½Êý¾Ý¿âÉÏÃæµÄ¡£
Àý×Ó´úÂë²Î¿¼£º
BlackBerry sample - SQLiteDemo¡£
×¢Ò⣺ÔÚ²åÈëÖÐÎĵÄʱºò£¬ÇëʹÓÃStatement.bindÖ¸ÁÔÚÎҵIJâÊÔÖУ¬¿ÉÒԺܺõı£´æÖÐÎÄÊý¾Ý¡£¶ÁÈ¡µÄʱºòÖ»ÐèҪʹÓÃResult ......
ʱ¼ä:
2009-08-14 21:18:18À´Ô´:
ÍøÂç ×÷Õß:
δ
Öª µã»÷:
214
´Î
CREATE TRIGGER
sql-statement ::=
......
sqlite3: Ò»¸öSQLiteÊý¾Ý¿âµÄÃüÁîÐнӿÚ
ÒëÕß×¢
ÔÎĵØÖ·£ºhttp://www.sqlite.org/sqlite.html
SQLite¿â°üº¬Ò»¸öÃû×Ö½Ð×ösqlite3 µÄÃüÁîÐÐ,Ëü¿ÉÒÔÈÃÓû§ÊÖ¹¤ÊäÈë²¢Ö´ÐÐÃæÏòSQLiteÊý¾Ý¿âµÄSQLÃüÁî¡£±¾ÎĵµÌṩһ¸öÑùʹÓÃsqlite3µÄ¼òҪ˵Ã÷¡£
¿ªÊ¼
Æô¶¯sqlite3 ³ÌÐò£¬½ö½öÐèÒªÇÃÈ ......