Returning 2147483647 and not displaying exception error.
This function within my code keeps throwing a SQL exception but not showing any error code or error... here is the exception:
# ERR: (MySQL error code: 0, SQLState: 00000 )
The function will keep running past that point but it will return the value "2147483647" or "3219256152". I realize that is the max value for a 32 bit INT. What could be the issue here, does anyone have suggestions?
Here is the function:
unsigned long Reporter::mkNlineRtestId()
{
{
unsigned long ret=0;
auto_ptr<sql::Connection> con;
con.reset(driver->connect(serverAddr.c_str(), userName.c_str(), password.c_str()));
con->setSchema("example");
auto_ptr<sql::Statement> stmt;
stmt.reset(con->createStatement());
string query="INSERT INTO " + table_testsummary + " (testId, submitTime) VALUES(NULL, NOW());SELECT LAST_INSERT_ID() AS currId;";
auto_ptr<sql::ResultSet> result;
result.reset(stmt->executeQuery(query.c_str()));
result->next();
ret=result->getUInt64("_currId");
return ret;
}
}
Edited 1 time(s). Last edit at 07/01/2009 02:44PM by Ashton Cummings.
Subject
Views
Written By
Posted
Returning 2147483647 and not displaying exception error.
6541
July 01, 2009 02:42PM
3687
July 03, 2009 03:16PM
2476
July 06, 2009 12:59PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.