Forum Stats

  • 3,839,332 Users
  • 2,262,484 Discussions


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

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.


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