Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mysql Connector C++ and floats

I can't find anything about getting floats from a result set or how to store floats in a prepared statement to create a query in order to insert the float number. Is it possible to do this? Should I store them using a char array? Thanks in advance

like image 787
Lautaro Avatar asked Mar 14 '13 14:03

Lautaro


1 Answers

For result retrieval, I expect you use ResultSet::getDouble - for statements, PreparedStatement::setDouble.

There does not seem to be accommodation for float specifically, but the underlying column definition will be FLOAT or DOUBLE.

like image 194
Steve Townsend Avatar answered Sep 18 '22 19:09

Steve Townsend