If you are looking for a fairly simple, embeddable in memory database ( actually a hash), gdbm is just what you need. Based on the Unix dbm, it has a simple API and an LGPL license. Of course, there is nothing like SQL queries, Encrypted Relational DBs, transaction support and all that, but then, if you need that, there are bigger and more complex databases available out there. ( There was one recently out, from IBM, but it was all java).
Here is what GDBM's man page says
GNU dbm is a set of database routines that use extensible hashing. It works similar to the standard UNIX dbm routines.