SQLite BLOB exporter with GUI

As promised in one of previous posts, I’ve written a little GUI-ed program in Java that allows exporting BLOBs data from SQLite to separate files. And I’m giving it away, with all sources.

The program has only one dependency – sqlitejdbc-v056.jar, which is a JDBC driver for SQLite databases. Download it from www.zentus.com/sqlitejdbc/ and put in the same folder where my program’s JAR is.
(UPD: actually it’s better to download newer driver – “sqlite-jdbc-3.7.2.jar” or latter from here – http://code.google.com/p/sqlite-jdbc/)

Besides the above-mentioned dependency, my program is just a single JAR file (sources are packed into it). To launch the program simple double-clicking on it should be just enough. If it isn’t, search web for “launch JAR” – you’ll find plenty of instructions. You must have Java installed, but that is an obvious thing I suppose.

Here’s the download link: mvmn.ho.ua/dld/sliteblobexp.jar (MD5 checksum = 99ca2488ac62f48721dced3c119d1271).
UPD: now also on GitHub – github.com/mvmn/sqlite-blob-export. See “distr” for binary distribution (built JAR file).

A small video of it in action:

Advertisements

25 thoughts on “SQLite BLOB exporter with GUI

  1. Pingback: SQLite: export BLOB to file; ToastMaster SpeechTimerz: export audio records; Apple CAF to MP3 « M.V.M-n.

      • I believe this is because you’re using an old version of SqLite. Firefox uses 3.7 and the file format has since changed. Found another solution for now to export BLOBs but it’s not free

        • Well, technically I’m not using a particular version of SqLite, but a particular SqLite JDBC driver: Zentus sqlitejdbc-v056.jar. Quoting Zentus site, “current version is v056, based on SQLite 3.6.14.2”.
          You should try replacing sqlitejdbc-v056.jar with this one: http://code.google.com/p/sqlite-jdbc/ – this should work with SqLite 3.7 without any changes to my code, though I haven’t checked myself yet. BTW, would be nice if you ‘d check it and let me know.

  2. Hi, Just wanted to say I used this today after hours of looking for a decent solution.

    It worked like a treat! Thank you so much for creating such a useful little program!

    Kind Regards

    Thomas

  3. Thanks for the program! I was able to extract the BLOB data but I’m trying to convert those BLOB files to GIF images. Is there a program that can do that? I tried renaming the files but it didn’t work. Thanks again.

  4. Not working with a 400 MB Sqlite db.
    Maybe wrong sqlite-jdbc, I used the sqlite-jdbc-3.7.2.jar and had to rename it to sqlite-jdbc-3.7.2.jar
    Maybe this is the problem or the big db.

    Anyway, it is amazing, that there is NO good bugfree application with GUI for sqlite DBs, but many for mysql etc.

      • Hmm, well, can you elaborate a bit on the “not working” part? Do you have GUI started but it all crashes after you open DB file? If yes, you may need to run it with higher RAM settings. If no, there must be a problem with that dependency JAR or Java version or something like this. In both cases you have to run the program from command line – so you could see the text of error it outputs, and send this text to me.
        Open command line, go to the folder where you have those two JARs, type in “java -jar sliteblobexp.jar -Xmx1024m” (without the quotes). Here the -Xmx1024 parameter allows JVM to take 1024 megabytes (well, 1 Gigabyte) of RAM. By default it’s smaller, so possibly you get OutOfMemory exceptions when opening big DB.

        In any case, try it and write me back what was the output.

        And yes, it is amazing there are no decent free utilities for SQLite – that’s the whole reason I wrote this utility of mine (-:

  5. Absolutely fantastic tool.
    I have noticed that the first blob data gets duplicated during export (Blob Data 1 and Blob Data 2) so shifting the name of the exported files. Been renaming the files manually to overcome this. Any one else observed the same thing

  6. Thanks a lot mvmn. It worked like a charm, only problem is there is no extension to the extracted files, can you help me out here if possible?

    • I can add this feature later.

      But maybe it would be faster to assign extension to a bunch of files using other means, like Total Commander for Windows, or terminal commands in Linux, or Automator for Mac OS?

        • The files that exporter produces bear no extension.

          But I suppose you mean something else, namely you want it to guess what the exported data is and assign corresponding extension. Like if the data is JPEG picture, put extension .jpg.

          Well, first of all if you’re exporting values of field of one table, all the data is probably of same type, so you can still assign extension manually – it’s not going to be different for each record, it should be the same.

          And second, exporter cannot reliably tell what data was in the column. Usually people don’t literally store files there, like JPEGs etc – because files have headers with some metadata that would be unnecessarily duplicated. So most of the time what you’re getting out is some raw data, not a file of some widespread type like mp3 or tiff or something like that.

        • P.S. Actually this should be completely separate utility – a one that would take a set of files, analyse contents of each and assign an extension based on the analysis.
          There are some FOSS libraries for such a content analysis (namely Apache Tika), so bigger part of the work is already done. Maybe later I will add GUI to that library and you could try that for your case. But again, this is a completely different story than getting BLOB-type fields values out of SQLite DBs.

        • P.P.S. Oh, a GUI wrapper for Apache Tika already exists. No need to make one.
          Here – http://tika.apache.org/download.html – is tika-app*.jar
          It only opens one file at a time, but that’s just enough to figure out what the content is. And then if it did figure it out, you can assign proper extension to all the files that are from same DB table and field.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s