equal
deleted
inserted
replaced
2 * db_bridge/mysql_db.cpp |
2 * db_bridge/mysql_db.cpp |
3 * Copyright 2008 (C) Markus Broeker |
3 * Copyright 2008 (C) Markus Broeker |
4 */ |
4 */ |
5 |
5 |
6 #include <mysql_db.h> |
6 #include <mysql_db.h> |
|
7 #include <console.h> |
7 |
8 |
8 MySQL_DB::MySQL_DB (std::string srv, std::string usr, std::string pwd, std::string db) |
9 MySQL_DB::MySQL_DB (std::string srv, std::string usr, std::string pwd, std::string db) |
9 { |
10 { |
10 server = srv; |
11 server = srv; |
11 user = (usr != "") ? usr : getenv ("USER"); |
12 user = (usr != "") ? usr : getenv ("USER"); |
13 database = db; |
14 database = db; |
14 conn = mysql_init (NULL); |
15 conn = mysql_init (NULL); |
15 |
16 |
16 if (server != "" && pwd == "") { |
17 if (server != "" && pwd == "") { |
17 std::cout << "Passwort von " << user << "@" << server << ": "; |
18 std::cout << "Passwort von " << user << "@" << server << ": "; |
18 std::getline (std::cin, password); |
19 Console::getpass (password); |
19 } |
20 } |
20 } |
21 } |
21 |
22 |
22 MySQL_DB::~MySQL_DB () |
23 MySQL_DB::~MySQL_DB () |
23 { |
24 { |