Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-01017: invalid username/password; logon denied while calling createConnection from C++

User_AKR7XMay 23 2022

I am trying to create the connection using OCI, but on executing the code I am getting the error
ORA-01017: invalid username/password; logon denied while calling from C++. This seems to be an old error and lots of posts on Google. But, I didn't find any post related to C++.
I have Oracle 19 c installed on Windows 10.
I am able to login into Oracle Sql Developer and didn't face any issue during login. I would appreciate it if someone throws any hint on this.
Thanks.

Environment *env;
Connection *conn;
const string userName = "system";
const string password = "password";
const string connectString = "";
int main()
{
Environment::createEnvironment(oracle::occi::Environment::THREADED_MUTEXED); 
env = Environment::createEnvironment(Environment::THREADED_MUTEXED);
	try {
		conn = env->createConnection(userName, password, connectString);
	}
	catch (const SQLException& e) {
		std::cout << e.what() << std::endl;
		exit(EXIT_FAILURE);
	}
}

Comments

Post Details

Added on May 23 2022
0 comments
351 views