Can I store some data into a database just from a c++ console application?

I just wanted to know if I can store data like name and password just from a console application in c++ into a database? I want to store names and passwords like this.

#include <iostream>
#include <string>
using namespace std;

int main(int argc, char** argv) {

int password;
string name;

cout<<"Name: "<<endl;
cout<<"Password: "<<endl;
cin password;

return 0;