tuxedo详细安装步骤(5)

2019-06-17 10:05

SQL*Plus: Release11.2.0.1.0 Production on Thu Mar 11 01:42:53 2010 Copyright (c) 1982, 2009, Oracle. All rights reserved.

Connected to:

Oracle Database11gEnterpriseEdition Release11.2.0.1.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>conn hr/hr; Connected.

SQL>select * from t_test1; ZJ NAME ---------- -------------------- 1 aaa 10wilson 10wilson SQL>

三、把前面两步的操作整合到一起,使Tuxedo客户端通过Tuxedo Server访问Oracle数据库

这步要把oracle_dome.pc和simpserv.c整合到一起,完成数据库访问。在Tuxedo服务器(主机2)上操作

1.把oracle_dome.pc和simpserv.c两个程序合并到一起,成为ora_proc_demo.pc程序源文件 [oracle@myapache simpapp]$rm -rf simpserv (先把simpserv可执行程序删除)

[oracle@myapache simpapp]$cp simpserv.c ora_proc_demo.pc (把simpserv.c程序文件拷贝到ora_proc_demo.pc) [oracle@myapache simpapp]$ls

access.031010 oracle_dome.lis README stderr ubb access.031110 oracle_dome.pc simpcl stdout ubbsimple a.out ora_demo simpcl.c tuxconfig ULOG.031010 oracle_dome.c ora_proc_demo.pc simpserv.c tux.env ULOG.031110 [oracle@myapache simpapp]$

把oracle_dome.pc中的程序合并到ora_proc_demo.pc中

[oracle@myapache simpapp]$vi ora_proc_demo.pc (添加以下标红的3处修改) #include #include

#include /* TUXEDO Header File */ #include /* TUXEDO Header File */

/*①初始化内容,添加在前面*/ #include \

EXEC SQL BEGIN DECLARE SECTION; char *uid = \ char name[20];

int id;

EXEC SQL END DECLARE SECTION;

void sqlerr() {

EXEC SQL WHENEVER SQLERROR CONTINUE; printf(\ EXEC SQL ROLLBACK WORK RELEASE; exit(1); }

/* tpsvrinit is executed when a server is booted, before it begins processing requests. It is not necessary to have this function. Also available is tpsvrdone (not used in this example), which is called at server shutdown time. */

#if defined(__STDC__) || defined(__cplusplus) tpsvrinit(int argc, char *argv[]) #else

tpsvrinit(argc, argv) int argc; char **argv; #endif

{

/* Some compilers warn if argc and argv aren't used. */ argc = argc; argv = argv;

/*②该函数程序启动时只运行一遍,把连接数据库的程序加在这里*/ EXEC SQL WHENEVER SQLERROR DO slqerr(); EXEC SQL CONNECT :uid;

/* userlog writes to the central TUXEDO message log */ userlog(\ return(0); }

/* This function performs the actual service requested by the client. Its argument is a structure containing among other things a pointer to the data buffer, and the length of the data buffer. */

#ifdef __cplusplus extern \ #endif void

#if defined(__STDC__) || defined(__cplusplus)

TOUPPER(TPSVCINFO *rqst) #else TOUPPER(rqst) TPSVCINFO *rqst; #endif { int i;

for(i = 0; i < rqst->len-1; i++)

rqst->data[i] = toupper(rqst->data[i]);

/*③该函数每接受一次请求执行一次,把写数据库的程序添加到这里*/ id = strlen(rqst->data); strcpy(name, rqst->data);

EXEC SQL INSERT INTO T_TEST1 VALUES(:id, :name); EXEC SQL COMMIT;

/* Return the transformed buffer to the requestor. */ tpreturn(TPSUCCESS, 0, rqst->data,0L, 0); } (完)


tuxedo详细安装步骤(5).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:全新版大学英语综合教程 第二册 课文原文及翻译 (免费的哦 亲)

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: