ODBC and C/C++

I want to connect to DB2 database (AS400) using ODBC and C/C++. I have been doing perl scripts to do this, using DBI interface. I have to say that is pretty simple with perl but I have no idea with C or C++.

Why C/C++ and not perl again? because this time I need a lot of speed. The process will query the database and save the fetched rows in a remote computer using a Round robin database (from rrd tools) every 5 minutes all year.

Being honest, I like C++ more than C just for the OOP that offers me, I think a lot of people think the same.

I installed unixODBC without problems so the next step should be start coding the C/C++ program but I can’t find a framework to start with.

Any ideas?

This sounds like something you could find on IBM DeveloperWorks.

Maybe i did not explain myself well. Actually just the database is located in the AS400, the program will run over an opensuse 10.3.

I have to use ODBC and not the native driver provided by IBM because it has a cost and unixODBC is free.

This is specifically DB2 and unixODBC. Although, it relates to AIX the good stuff is universal.

Thank you for your help.
I can’t make it work for my purpose.