77范文网 - 专业文章范例文档资料分享平台

tuxedo详细安装步骤(5)

来源:网络收集 时间:2019-06-17 下载这篇文档 手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:或QQ: 处理(尽可能给您提供完整文档),感谢您的支持与谅解。点击这里给我发消息

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); } (完)

百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库tuxedo详细安装步骤(5)在线全文阅读。

tuxedo详细安装步骤(5).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印 下载失败或者文档不完整,请联系客服人员解决!
本文链接:https://www.77cn.com.cn/wenku/zonghe/659362.html(转载请注明文章来源)
Copyright © 2008-2022 免费范文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ: 邮箱:tiandhx2@hotmail.com
苏ICP备16052595号-18
× 注册会员免费下载(下载后可以自由复制和排版)
注册会员下载
全站内容免费自由复制
注册会员下载
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: