I'm stuck on what appears to be a simple case. Coming from the JDBC side of things, selecting a date column from a table is simple and you can fetch the value from the ResultSet using the getDate methods. However, there are no date methods on the C++ API. Here's what happens and what I'm trying to solve:
- Calling the getUInt methods on ResultSet return only the year of the date
- I'm trying REALLY hard to stay SQL 99 compliant
- I can use the unix_timestamp date function, but that breaks my SQL 99 compliance
The SQL I'm using that is SQL 99 compliant is:
select modified_date from foo_bar
If I make this call:
time_t date = resultSet->getUInt("modified_date");
The value is just the year part (i.e. 2009). The only way I can see to fix it is breaking SQL 99 compliance and using a select like this:
select unix_timestamp(modified_date) from foo_bar
This works using the getUInt methods. However, the code is abstracted in a such a manner that I can hit any database as by just plugging in a different driver (very JDBC like).
Is there any way to select a date column and get the value back from the C++ API without using a the unix_timestamp function?