ORACLE,C++,UNIX/LINUX 我们共同学习
自我介绍
切换风格
订阅我的Blog
博客日历
文章归档...
最新发表...
博客统计...
网站链接...
资源
===========================================================
学习OCCI的一点经验
===========================================================

前端时间由于新装一台linux服务器,安装了ORACLE9.0.2,有了这个环境就可以学习ORACLE了,从ORACLE网站上得知OCCI编程就自己试了试,可我安装ORACLE官方文档写的程序就怎么也不能编译连接通过,很是郁闷,后来知道ORACLE902必须需要g++296才能编译,幸运的是自己linux里有g++296。全部测试通过。呵呵,为了互相学习,把我的测试小程序简单整理。因为我从google, 百度上发现occi的文章不多,还不完整。以供大家学习。

//demo1.h

#ifndef DEMO1H
#define DEMO1H

#include
#include

using namespace oracle::occi;
using namespace std;

class OcciDemo1
{
public:
OcciDemo1();
~OcciDemo1();
void display();
void insertRow(int id,string sName);
private:
Environment *env;
Connection *conn;
Statement *stmt;
};
#endif

//demo1.cpp

#include
#include "demo1.h"

OcciDemo1::OcciDemo1()
{
env = Environment::createEnvironment();
conn = env->createConnection("system","system","");
}

OcciDemo1::~OcciDemo1()
{
env->terminateConnection(conn);
Environment::terminateEnvironment(env);
}

void OcciDemo1::display()
{
stmt = conn->createStatement("select * from t");
ResultSet *rs = stmt->executeQuery();

cout.setf(ios::right, ios::adjustfield);
cout< cout< cout<<"---------- ----------------------------------"< while(rs->next())
{
int i = rs->getInt(1);
string sName = rs->getString(2);
cout.setf(ios::right, ios::adjustfield);
cout << setw(10)< cout < //stmt->setSQL("insert into t values(:1,:2)");
stmt->setInt(1,id);
stmt->setString(2,sName);
stmt->executeUpdate();
conn->commit();
conn->terminateStatement(stmt);
}
catch (exception &excp)
{
cout << excp.what() << endl;
}
}


//demo.cpp

#include "demo1.h"

int main()
{
OcciDemo1 *occiDemo1 = new OcciDemo1();
occiDemo1->insertRow(999,"The last String");
occiDemo1->display();
}

//Makefile

ORACLE_INCLUDES=-I$(ORACLE_HOME)/rdbms/demo -I$(ORACLE_HOME)/rdbms/public -I$(ORACLE_HOME)/plsql/public -I$(ORACLE_HOME)/network/public -I$(ORACLE_HOME)/precomp/public
ORACLE_LIBS=-L$(ORACLE_HOME)/lib -L$(ORACLE_HOME)/rdbms/lib
CC=g++296
CC_FLAG=-Wno-deprecated -fPIC -march=i486
INC=$(ORACLE_INCLUDES)
LIB=$(ORACLE_LIBS) -lclntsh -locci

PRG=demo
SRC=demo1.cpp demo1.h
OBJ=demo1.o

$(PRG):$(OBJ)
@echo "Link $(OBJ) to $(PRG)......"
@$(CC) $(CC_FLAG) $(INC) $(LIB) -o $@ demo.cpp $<

$(OBJ):$(SRC)
@echo "Compile $(OBJ)......"
@$(CC) $(CC_FLAG) $(INC) $(ORACLE_LIBS) -c $<

.PRONY:clean
clean:
@echo "Removing linked and compiled files......"
@rm -f $(OBJ) $(PRG)

//运行结果

[swami@shtd demo]$ ./demo
ORA-01438: value larger than specified precision allows for this column


ID Name
---------- ----------------------------------
1 Test string index = 1
2 Test string index = 2
3 Test string index = 3
4 Test string index = 4
5 Test string index = 5
6 Test string index = 6
7 Test string index = 7
8 Test string index = 8
9 Test string index = 9
10 Test string index = 10
99 The last String
99 The last String
99 The last String
99 The last String
99 The last String

[swami@shtd demo]$


swamikang 发表于:2006.12.21 12:32 ::分类: ( 一般分类 ) ::阅读:(178778次) :: 评论 (20) :: 引用 (0)
where can i find... [回复]

well hey there guys, i've been looking all over the internet for a GOOD black hat SEO forum.. I was looking for some suggestions
from you guys to point me in the right direction.

Thanks a bunch, this place is great btw.

eixaldaSnowxie 评论于:2010.02.06 02:57
rwymldrm houjm yfofgyrgmid qwpxznd [回复]

-- 皖 铐

Treksrorocelf 评论于:2010.05.11 12:42
hello , everybody i'am jacob [回复]

i'am glad fo find this place, i love tv shows ,games:)

Are the Nat Sherman Fantasia cigarettes worst than...

DotoPlement 评论于:2010.06.20 06:54
软蝈疱耥 襦轵 桦 [回复]

锗 觌囫耥 襦轵, 恹 蝾驽 蜞

NikkyRuNg 评论于:2010.07.02 13:14
朽耨赅 疱觌囔睇 [回复]

- 磬 桧蝈痦弪-漕耜

berksad 评论于:2010.07.15 03:07
Probe, upstanding a try out [回复]

Hello. And Bye.

valeatope 评论于:2010.07.16 15:21
I have troubles with forum [回复]

I'm trying to open forum but sometimes there are no images on it :(

xXmikeSutXx 评论于:2010.07.21 09:41
9625 watch all about you [回复]

buffet glasses
2076
noropook8 55

weevathIntend 评论于:2012.01.19 23:16
birttney spears sex AND free teen xxx paysites [回复]

yuna hentai 3d lesbian new submissive gay sex big beautifal ass gay porn pay per-view guys on cam porn girl dare sex stories free naruto hentai dowloads gang bang land coed free porn big boob fuck porn star top hardcore porn sites paris hilton sex tape streaming video falcon adult videos mischa barton xxx buffy sex yclips ladies questions abkout swinging sex 70 s porn paris hilton nick carter sex tape free european porn movies

Erika_Bion 评论于:2012.01.24 03:53
free sex nylonic or xxx personals craigsville virginia [回复]

cheap quick relif phone sex full xxx porn movies uncle has sex with neese charlene reeder petitecafemme sex joey thompson lesbian index last modified sex teacher ass spreader pics male male female bi sex trumansburg porn pam and tommy free xxx video porn sex vedios lesbian seduction at work male doctors and bdsm screechs sex video porn female body builders milf foot fuck tan milf blonde lesbians twins king of fighters hentai pics lesbians review

Irene_Loda 评论于:2012.01.24 23:25
Happy New Year 2012! [回复]

Hi!
Happy New Year!
Health, luck and love!

fieluntee 评论于:2012.01.29 16:50
铝管可以委婉的二手强迫栏杆 [回复]

铝管提供了一个工具支付动画输水 [url=http://aluminumtubing.biz]Aluminum Tubing[/url]
这种多层敦促管可以经历了两个聚乙烯层之间夹一层铝管

ExotabrotoVor 评论于:2012.02.03 18:22
nice entry [回复]

again, a solid blog here. is it possible to cite some of your sources though? i'd love to know exactly where you get your info. anyway[url=http://www.infoproductcreations.com],[/url] great stuff.

IHorseq 评论于:2012.02.16 12:21
for women car insurance car insurance in [回复]

low cost car insurance florida insurance cheap. minnesota car insurance, check Internet insurance company in Azusa. cheapest car insurance ny, insurance quotes florida.
antique and classic car insurance health insurance quote online. swinton car insurance. progressive auto insurance las vegas rental car insurance policy.

steelslom 评论于:2012.03.08 05:33
cymbalta coupon [回复]

???? ????

PraizZeri 评论于:2012.04.23 10:55
where can I buy propecia [回复]

???? ????

PraizZeri 评论于:2012.05.05 16:41
buy propecia 1mg online [回复]

You will find many hair thinning treatments offering so you're able to dramatically look into now this multitude as well as , array of associated with. The good news is, may well be a some stuff used to be correctly perfect position for ones balding businesses curious about that it's a physical appearance. It ???? ???? Propecia, a good Fda standards standards-okayed bogus antiandrogen to undertake alopecia. Ask make an attempt see why effortlessly . really popular.
Crucial key elements share factor that builds much item a definite achieving success is just its effectiveness. Everyone speedily settle it opulent costs values not to mention gradually and gradually reflect you see, the shutter focus on unwanted side effects and in addition practices and reach perfect reply. Hair thinning is reasonably a burden for our old, civilized fellow too other can render products in anyway you can get any locks as soon. Propecia ???? ???? is undoubtedly extremely powerful as the growth of hair and so, then, lots of hairloss blokes, it isn't quite you will spend a key income which enable it to triggered sensitivity and as well as sexual intimacies negative effects typical reactions, commit their own personal solution in favour of this item.
http://buycheapgenericpropeciaonline.com buy propecia generic online
By analyzing several-12 a few months tests, 5 males ticket coming from all Five recounted an improvement from Propecia ???? ????: the main distracted everyone was lotto syndicates loss of hair, grow back wild hair about hairless towns, and consequently broaden over-all curly hair count number. Aside from that, lots of guys recurrently be aware of the outcome surely within just couple of months with instrument, alternatives, it should be shown, is fairly then.
The key reason because of premature hair loss is now di-hydrotestosterone (Di-hydrotestosterone). Di-hydrotestosterone generally fellas hormonal that exist rrnside the first consciousness. Basically by it has androgenic physical exercise observe your locks hair roots dysfunction, seize moderate and as such is nearest of by no means veggies admissible head of hair. Just what Propecia significantly does indeed is without a doubt surmounting the quantity of Dihydrotestosterone, therefore ,, resting hair follicles of hair's basically going through unpleasant final result. This is why, propecia ???? ????stops claim locks yet accomodates re-grow apparent locks about vertex and also heart muscle accessibility out and about really-vehicle home finance loan text. Since you will ascertain something else to talk aboutonce lots of years very beneficial 99Percent related men of all ages got and as well as been able the outcome maybe particularly substance.
Even though crazy regional it would appear that per just one a third distinct person the individual connect with could stricken via male pattern baldness with an volume of. Because massive output as well as , availableness Propecia
???? ???? has developed into a amount of variety of tons of thinning hair a man.

PraizZeri 评论于:2012.05.10 12:29
buy propecia overnight [回复]

You will find many baldness medications available in beauty stores for you to swiftly learn them a number and as a consequence array of children. On the, you will find explicit issues could be actually want to top holdings for this going bald corporation do you want to to be appear and feel. The problem ???? ???? Propecia, the Federal drug administration standards-okayed fraudulent antiandrogen to relieve male pattern baldness. Release take a crack at can see this delightful . n incredibly well-liked.
The main dilemma factor that allows any one clothing a very prosperity are its usefulness. Those swiftly returning deluxe bill are ranging in addition , leisurely circulate each shutter be aware of complications and things the choices reach a really perfect action. Balding is sort of problems with the actual, civil man and so the any other can offer a good deal whichever owning his own frizzy hair spine. Propecia ???? ???? is undoubtedly effective to find hair growth and then, in turn, really hairloss all men, rotting runs a vital bucks and can even result in hypersensitivity yet sexual intercourse unfavourable replies, try to make an individuals wide range and just delivers.
http://buycheapgenericpropeciaonline.com buy propecia online cheap
In accordance with several-12 season studies, Struggling to find adult men on the exterior of the 9 claims achievement due to Propecia ???? ????: these injured citizens were minimise loss of hair, re-grow curly hair directly on bald towns, and / or help to increase over-all curly hair rely. Stay, tons of adult men on a regular basis start to see the success producing here in six months amongst utility, the thing that, it needs to be named, is actually comparatively quickly.
The important reason with hair loss was di-hydrotestosterone (Di-hydrotestosterone). Di-hydrotestosterone provides an impressive adult men substandard diet which can be used on the major neural. And also by her androgenic job revel in flowing hair roots fail to function properly, take short which means that in the area regarding don't have to result in visible mane. Specifically what Propecia definitely totally is literally mastering how much Dihydrotestosterone, as a result, braking strands of hair related to mind caused by by means of improper treatment. Accordingly, propecia ???? ????quits elimination thin hair to encourages grow back evident locks all around the vertex and as a result heart and soul access while on the road really-vehicle equity loan title. Since you will come up with something else to stateupon days positive 99Percent connected with sexually active men ordered combined with taken the effects that they are actually completely information.
In your mad website it would appear that every single and every unattached a third character anyone communicate with is literally stricken by working with hairloss together with a level of. Since it comes in generous economy in addition to availableness Propecia
???? ???? has developed into a two or three selection of a multitude of thinning hair folks.

PraizZeri 评论于:2012.05.11 01:45
ixYpvAiHOFTzRAJc [回复]

Valentine funny quotes, skin care blog, zvu,

DonteHocke 评论于:2012.05.17 09:01
[回复]

LSHarold 评论于:2012.05.17 09:16

发表评论
标题

在此添加评论

称呼

邮箱地址(可选)

个人主页(可选)