#include <ecpglib.h>
#include <ecpgerrno.h>
#include <sqlca.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
Go to the source code of this file.
|
#define | ECPGdebug(X, Y) ECPGdebug((X)+100,(Y)) |
|
◆ ECPGdebug
#define ECPGdebug |
( |
|
X, |
|
|
|
Y |
|
) |
| ECPGdebug((X)+100,(Y)) |
◆ main()
Definition at line 22 of file connect-test1.c.
23{
24
25
26
27
28#line 16 "test1.pgc"
29 char db [ 200 ] ;
30
31#line 17 "test1.pgc"
32 char pw [ 200 ] ;
33
34#line 18 "test1.pgc"
35
36
38
39 {
ECPGconnect(__LINE__, 0,
"ecpg2_regression" , NULL, NULL ,
"main", 0); }
40#line 22 "test1.pgc"
41
43#line 23 "test1.pgc"
44
46#line 24 "test1.pgc"
47
48
49 {
ECPGconnect(__LINE__, 0,
"ecpg2_regression@localhost" , NULL, NULL ,
"main", 0); }
50#line 26 "test1.pgc"
51
53#line 27 "test1.pgc"
54
55
56 {
ECPGconnect(__LINE__, 0,
"@localhost" ,
"regress_ecpg_user2" , NULL ,
"main", 0); }
57#line 29 "test1.pgc"
58
60#line 30 "test1.pgc"
61
62
63
64
65
66 {
ECPGconnect(__LINE__, 0,
"tcp:postgresql://localhost/ecpg2_regression" ,
"regress_ecpg_user1" ,
"connectpw" , NULL, 0); }
67#line 35 "test1.pgc"
68
70#line 36 "test1.pgc"
71
72
73 {
ECPGconnect(__LINE__, 0,
"tcp:postgresql://localhost/" ,
"regress_ecpg_user2" , NULL , NULL, 0); }
74#line 38 "test1.pgc"
75
77#line 39 "test1.pgc"
78
79
80 strcpy(pw, "connectpw");
81 strcpy(db, "tcp:postgresql://localhost/ecpg2_regression");
82 {
ECPGconnect(__LINE__, 0, db ,
"regress_ecpg_user1" , pw , NULL, 0); }
83#line 43 "test1.pgc"
84
86#line 44 "test1.pgc"
87
88
89 {
ECPGconnect(__LINE__, 0,
"unix:postgresql://localhost/ecpg2_regression" ,
"regress_ecpg_user1" ,
"connectpw" , NULL, 0); }
90#line 46 "test1.pgc"
91
93#line 47 "test1.pgc"
94
95
96 {
ECPGconnect(__LINE__, 0,
"unix:postgresql://localhost/ecpg2_regression?connect_timeout=180" ,
"regress_ecpg_user1" , NULL , NULL, 0); }
97#line 49 "test1.pgc"
98
100#line 50 "test1.pgc"
101
102
103
104 {
ECPGconnect(__LINE__, 0,
"tcp:postgresql://localhost/nonexistent" ,
"regress_ecpg_user1" ,
"connectpw" , NULL, 0); }
105#line 53 "test1.pgc"
106
108#line 54 "test1.pgc"
109
110
111
112 {
ECPGconnect(__LINE__, 0,
"tcp:postgresql://127.0.0.1:20/ecpg2_regression" ,
"regress_ecpg_user1" ,
"connectpw" , NULL, 0); }
113#line 57 "test1.pgc"
114
115
116
117
118 {
ECPGconnect(__LINE__, 0,
"unix:postgresql://localhost/ecpg2_regression" ,
"regress_ecpg_user1" ,
"wrongpw" , NULL, 0); }
119#line 61 "test1.pgc"
120
121
122
123 return 0;
124}
bool ECPGdisconnect(int lineno, const char *connection_name)
bool ECPGconnect(int lineno, int c, const char *name, const char *user, const char *passwd, const char *connection_name, int autocommit)
bool ECPGdo(const int lineno, const int compat, const int force_indicator, const char *connection_name, const bool questionmarks, const int st, const char *query,...)
References ECPGconnect(), ECPGdebug, ECPGdisconnect(), ECPGdo(), ECPGst_normal, ECPGt_EOIT, and ECPGt_EORT.