Stack Overflow на русском Asked on December 26, 2021
Код:
#include <SQLAPI.h>
#include <iostream>
using namespace std;
int main()
{
SAConnection con;
try
{
con.Connect("localhost@db_for_cpp", "lofectr", "<password>", SA_PostgreSQL_Client);
SACommand cmd(&con, "select * from data");
cmd.Execute();
while( cmd.FetchNext() )
cout<<"name: "<<cmd[2].asString().GetMultiByteChars()<<"tdata: "<<cmd[1].asString().GetMultiByteChars()<<endl;
}
catch(SAException& x)
{
printf("ERROR %d: %sn",
x.ErrNativeCode(), x.ErrText().GetMultiByteChars());
}
return 0;
}
Команда компиляции:
g++ main.cpp -o program -L/home/lofectr/Документы/libs/SQLAPI/lib -I/home/lofectr/Документы/libs/SQLAPI/include/
Система: Linux Ubuntu x64
пути до библиотеки указанны верно.
В чем проблема?
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP