I am using mysql c++ connector with this (a bit simplified) code.
try
{
statement->setString(1, word);
statement->executeUpdate();
}
catch( sql
See the note for dynamic_cast, throw, typeid don't work with shared libraries on the GCC Frequently Asked Questions page.
Because you are using dlopen(), you need to link your executable with the -E flag (or pass-Wl,-E to g++ if g++ is invoking the linker) and pass the RTLD_GLOBAL flag to dlopen().