finally I found a slot to work on this. Stilll struggling
I have installed H2 database on my windows machine
started the server
C:\Program Files (x86)\H2\bin>java -cp h2-1.4.200.jar org.h2.tools.Server
TCP server running at tcp://192.168.200.122:9092 (only local connections)
PG server running at pg://192.168.200.122:5435 (only local connections)
Web Console server running at http://192.168.200.122:8082 (only local connections)
C:\Program Files (x86)\H2\bin>java -cp h2-1.4.200.jar org.h2.tools.Server
TCP server running at tcp://192.168.200.122:9092 (only local connections)
PG server running at pg://192.168.200.122:5435 (only local connections)
Web Console server running at http://192.168.200.122:8082 (only local connections)
To copy to clipboard, switch view to plain text mode
It seems to be running
QString connectString
= QStringLiteral
( "Driver={PostgreSQL Unicode(x64)};"
"Database=C:\\database\\eventDB;"
"UID=sa;"
"PWD=\"\""
"port=9092;"
"Server=localhost;");
db.setDatabaseName(connectString);
bool ok = db.open("sa","");
if(!ok)
qDebug() << db.lastError();
QSqlDatabase db = QSqlDatabase::addDatabase("QODBC");
QString connectString = QStringLiteral(
"Driver={PostgreSQL Unicode(x64)};"
"Database=C:\\database\\eventDB;"
"UID=sa;"
"PWD=\"\""
"port=9092;"
"Server=localhost;");
db.setDatabaseName(connectString);
bool ok = db.open("sa","");
if(!ok)
qDebug() << db.lastError();
To copy to clipboard, switch view to plain text mode
NO LUCK AT THIS POINT. This could be my connection string as I was trying DNSless connection.
Error Output
QDEBUG
: H2Connection
::test_case1() QSqlError("101",
"QODBC3: Unable to connect",
"could not connect to server: Connection refused (0x0000274D/10061)\n\tIs the server running on host \"localhost\" (::1) and accepting\n\tTCP/IP connections on port 5432?\ncould not connect to server: Connection refused (0x0000274D/10061)\n\tIs the server running on host \"localhost\" (127.0.0.1) and accepting\n\tTCP/IP connections on port 5432?\n")
QDEBUG : H2Connection::test_case1() QSqlError("101", "QODBC3: Unable to connect", "could not connect to server: Connection refused (0x0000274D/10061)\n\tIs the server running on host \"localhost\" (::1) and accepting\n\tTCP/IP connections on port 5432?\ncould not connect to server: Connection refused (0x0000274D/10061)\n\tIs the server running on host \"localhost\" (127.0.0.1) and accepting\n\tTCP/IP connections on port 5432?\n")
To copy to clipboard, switch view to plain text mode
any thoughts are most welcome
Some more testing tomorrow..
baray98
Bookmarks