An example of an Oracle database is not used in tuxedo (transferred from the BEA website)

xiaoxiao2021-03-06  58

Int Tpsvrinit (int Argc, char ** argv)

{

EXEC SQL Begin Declare Section;

VARCHAR Username [20];

VARCHAR Password [20];

Exec SQL End Declare Section;

STRCPY (Username.arr, "Scott");

UserName.len = strlne (username.arr);

STRCPY (Password.arr, "Tiger");

Password.len = Strlen (Password.arr);

Exec SQL WHENEVER SQLERROR GOTO SQLERROR;

Exec SQL Connect: UserName Identified by: Password / * At ABC

Using: dbstring (if use dblink use it) * /;

SQLERROR:

Exec SQL WHENEVER SQLERROR Continue;

UserLog ("TPSVRINIT Connect DB SQLCODE = [% D] ERR = [%

s] ", sqlca.sqlcode, sqlca.sqlerrm.sqlerrmc);

Return (0);

}

Void Tpsvrdone ()

{

EXEC SQL Commit Work Release;

IF (sqlca.sqlcode)

UserLog ("Close Database Failed Sqlcode = [% D]", Sqlca.sqlcode;

Else

UserLog ("Tpsvrdone (): Shutdown Server Successful!");

}

转载请注明原文地址:https://www.9cbs.com/read-118622.html

New Post(0)