samedi 17 octobre 2015

SQL command to load image into SQLite DB

I'm trying to create a database using SQLite Manager that will loaded up in an Android application.

My problem is that I can't figure out how to load an image from my pc into the database.

My table is structured like this:

artwork_table(ID INTEGER PRIMARY KEY AUTOINCREMENT, PAINTING_NAME TEXT, ARTIST TEXT, YEAR INTEGER, INFO TEXT, PAINTING_IMAGE BLOB)

My SQL command so far is

INSERT INTO artwork_table VALUES (1, "Mona Lisa", "Leonardo da Vinci",    "1517", "Real Good", 'C:\Users\Conor\Desktop\image.jpg')

Is there not some function like readFile() or loadFile() I can pass my image's path to to load it in as data rather than a string?

I know how to load the image into the db from within the Android app but my goal is to have the db constructed beforehand.

Aucun commentaire:

Enregistrer un commentaire