Using a DB with C++ is a real mess and it was refreshing when I moved to Java to be able to use a unified system to abstract the whole layer away (aka Hibernate).
Another approach is a C++ object <-> xml mapping like codesynthesis xsd
I never liked the direct hibernate/serialisation approach it breaks too much if you ever need to change the class.