00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef ORA_CON_H
00024 #define ORA_CON_H
00025
00026 #include <oci.h>
00027 #include "../../lib/srdb1/db_pool.h"
00028 #include "../../lib/srdb1/db_id.h"
00029 #include "../../lib/srdb1/db_val.h"
00030
00031
00032 struct query_data {
00033 OCIStmt** _rs;
00034 const db_val_t* _v;
00035 int _n;
00036 const db_val_t* _w;
00037 int _nw;
00038 };
00039 typedef struct query_data query_data_t;
00040
00041
00042 struct ora_con {
00043 struct pool_con hdr;
00044
00045 OCIError *errhp;
00046 OCISvcCtx *svchp;
00047 OCIEnv *envhp;
00048 OCISession *authp;
00049 OCIServer *srvhp;
00050
00051 int connected;
00052 int bindpos;
00053
00054 query_data_t* pqdata;
00055
00056 int uri_len;
00057 char uri[];
00058 };
00059 typedef struct ora_con ora_con_t;
00060
00061
00062
00063
00064
00065 #define CON_ORA(db_con) ((ora_con_t*)db_con->tail)
00066
00067
00068
00069
00070
00071
00072 ora_con_t* db_oracle_new_connection(const struct db_id* id);
00073
00074
00075
00076
00077
00078 void db_oracle_free_connection(ora_con_t* con);
00079
00080
00081
00082
00083
00084 void db_oracle_disconnect(ora_con_t* con);
00085
00086
00087
00088
00089
00090 sword db_oracle_reconnect(ora_con_t* con);
00091
00092
00093
00094
00095
00096 const char* db_oracle_error(ora_con_t* con, sword status);
00097
00098 #endif