How to save bitmap in database?

前端 未结 4 1368
抹茶落季
抹茶落季 2021-02-02 02:46

I want to know how to save a bitmap in database. I created table in db as:

@Override
public void onCreate(SQLiteDatabase db)
{
    db.execSQL(\"CREATE TABLE \" +         


        
4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-02 03:33

    Write it to binary and store as a BLOB... You are on the right track. You can also do it with objects.

    http://www.idevelopment.info/data/Programming/java/jdbc/LOBS/BLOBFileExample.java

    Dont forget Google code too:

    http://www.google.de/search?sourceid=chrome&ie=UTF-8&q=java+write+to+binary+and+store+in+BLOB#hl=de&safe=off&sa=X&ei=9y_3TbzLBcOZOobyqagK&ved=0CBgQBSgA&q=google+code+java+write+to+binary+and+stored+in+BLOB&spell=1&bav=on.2,or.r_gc.r_pw.&fp=562730531e5070d5&biw=1440&bih=787

提交回复
热议问题