Quantcast
Channel: MySQL Forums - Connector/C++
Viewing all articles
Browse latest Browse all 527

Stored procedure + preparedStatement + autocommit=0 doesn't work! (no replies)

$
0
0
Hello,
i don't understand what is going to happen...
this is my simple code:
--------------------------------------------------------------------------
conn->setAutoCommit(0);
preparedStmt = conn->prepareStatement("call spLogin(?,?,?)");
preparedStmt->setString(1, (const caracter *) username);
preparedStmt->setString(2, (const caracter *) password);
preparedStmt->setInt(3, age);
ret = preparedStmt->executeQuery();
if (ret->next()) {
id_user = ret->getInt(1)); // idUserinfo
conn->commit(); <-- THIS LINE DOES NOTHING!!!
}

When I execute the commit function no record was updated in the database.
If I replace the stored with embedded SQL it works very well!

Viewing all articles
Browse latest Browse all 527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>