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!");
}