I want to know if I enter an incorrect parameter on createConnection, what value will it return to me? The situation I encountered was in
try{
Environment *env;
Connection *conn;
char *usrName = "123";//A deliberately incorrect value
char* usrPwd="123";//A deliberately incorrect value
char* connectStr="123:1521/ ";//A deliberately incorrect value
env = Environment::createEnvironment();
conn = env->createConnection(usrName,usrPwd,connectStr);
}
catch(SQLException p){
cout<<"ErrorCode:"<
cout<<"ErrorMsg:"<
return -1;
}
It will output error code and error message, but instead of return, it will enter interrupt error, indicating heap corruption. So the question is, how do I handle the error after I enter the wrong parameters (account, password, port, etc.)