Enhydra-fr: connextion ? bd postgres par c++
amine hayat <[email protected]> Thu, 10 Jul 2003 13:38:00 +0200 (CEST)
| Newsgroups | gmane.comp.java.enhydra.general.french |
|---|---|
| Message-ID | <[email protected]> |
Bonjour donc,
voila je souhaite se connecter =E0 une base de
donne=E9s postgres (je suis d=E9butant avec=20
postgres) sous lunix (SuSue).
j'ai donc dons Kdevelop la fonction main() que j'ai
ecris est la suivante:
int main(int argc, char *argv[])
{
KAboutData aboutData( "essai", I18N_NOOP("Essai"),
VERSION, description, KAboutData::License_GPL,
"(c) 2002, hayat", 0, 0, "[email protected]");
aboutData.addAuthor("hayat",0,
"[email protected]");
KCmdLineArgs::init( argc, argv, &aboutData );
KCmdLineArgs::addCmdLineOptions( options ); // Add
our own options.
QApplication app (argc,argv);
QSqlDatabase * defaultDB=3D
QSqlDatabase::addDatabase("QPSQL7");
if(defaultDB)
{
defaultDB->setDatabaseName("test");
defaultDB->setUserName("postgres");
defaultDB->setPassword("postgres");
defaultDB->setHostName("linux-38");
if (defaultDB->open())
//QSqlQuery target;
/*QSqlQuery query ;
query.exec("select* from hayattable;");
col->setText(query.Value);*/
cout<<"vous avez connecte a la base de donnees
"<<endl;
else
cout<<"vous n'avez pas connecte a la base de donnees
"<<endl;
}
j'obtiens le=20
message suivant:
_IceTransSocketUNIXConnect: Cannot connect to
non-local host linux
Session management error: Could not open network
socket
donc =E0 votre bon coeur.=20
___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en fran=E7ais !
Yahoo! Mail : http://fr.mail.yahoo.com