Add files via upload

This commit is contained in:
Chris-bot374
2024-06-30 20:30:54 +02:00
committed by GitHub
parent 5f4c6ba3b0
commit 5d161c7443
7 changed files with 235 additions and 0 deletions

25
DBHandler/DBHandler.cpp Normal file
View File

@@ -0,0 +1,25 @@
#include "DBHandler.hpp"
#include <iostream>
//host = localhost port = 5432 dbname = postgres user = postgres password = ****
DBHandler::DBHandler(std::string connStr) : connectionObject(connStr.c_str()) {
try {
if (connectionObject.is_open()) {
std::cout << "Databased connected" << std::endl;
}
else
std::cout << "Failed to connect to Databased" << std::endl;
}
catch (const std::exception& e) {
std::cerr << "Error: " << e.what() << std::endl;
}
};