July 24, 2011

SQLite, Java and Applets

I've basically wanted to die over how painful the combination of SQLite, Java and Applets have been. Honestly, I spent well over 12 hours trying to get the combination to work and it seems to be something very few people do... oddly. I tired about 3 different solutions and the end result was still unsuccessful.

The solutions that I tried were very well designed and I'm actually very impressed at the quality of Java SQLite wrappers and JDBCs that exist. Unfortunately, they are not designed to open SQLite files located inside of a JAR file. That was basically my only real requirement for using SQLite, and it looks to me like I'm going to have to implement my own 'database system'. I could use XML, but at this point in time I'm thinking serialization could be more useful and faster. My database needs don't even require any links between tables so SQLite was almost overkill. Yes, something light-weight is overkill...

I've updated the applets with some background music, and I hacked together a workaround for my 'lack of database issue'. Probably be my next task, as I want something more 'solid' than a few text files. I'm actually curious if you can even use JDBC on a file inside of the JAR that your code is running in... So far, it appears to be down right impossible and very few people seem to have written anything about it. Oh well, it is getting late and Monday is upon us again!

No comments :

Post a Comment