home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / vgserv45.zip / BASE / HPTWGS2 / include / fcwosqr.h < prev    next >
C/C++ Source or Header  |  2001-03-21  |  6KB  |  154 lines

  1. /*****************************************************************************/
  2. /*                                                                           */
  3. /*                           OCO SOURCE MATERIALS                            */
  4. /*                             IBM CONFIDENTIAL                              */
  5. /*                                    OR                                     */
  6. /*                        IBM CONFIDENTIAL RESTRICTED                        */
  7. /*            WHEN COMBINED WITH THE AGGREGATED OCO SOURCE MODULES           */
  8. /*                           FOR THIS PROGRAM PRODUCT                        */
  9. /*                                                                           */
  10. /*      VisualAge Generator Server for OS/2, AIX, HP-UX, and Windows NT      */
  11. /*                          Version 3.0  5697-C28                            */
  12. /*                    (C) COPYRIGHT IBM CORP. 1994,1997                      */
  13. /*                                                                           */
  14. /*****************************************************************************/
  15. #ifndef  FCWOSQR_H
  16. #define  FCWOSQR_H
  17.  
  18. class Item;
  19.  
  20. class FCWOSQR : public Record
  21. {
  22.   public:
  23.            FCWOSQR( char*, long l );
  24.           ~FCWOSQR();
  25.  
  26.      void Setup( void* = 0 );
  27.  
  28.      int  BeginAdd( short stmtID, short opt, short ida, short oda );
  29.      int  EndAdd( char* stmt );
  30.  
  31.      int  BeginISU( short opr, short stmtID, short opt, short ida, short oda );
  32.      int  EndSetIU( short opr, char* stmt );
  33.  
  34.      int  BeginInq( short stmtID, short opt, short ida, short oda )
  35.           { return BeginISU( INQUIRY_OPR, stmtID, opt, ida, oda ); };
  36.      int  EndInq( char* stmt );
  37.      int  BeginUpd( short stmtID,  short opt, short ida, short oda )
  38.           { return BeginISU( UPDATE_OPR, stmtID, opt, ida, oda ); };
  39.      int  EndUpd( char* stmt );
  40.  
  41.      int  BegRpDl ( short opr, short stmtID,  short opt, short ida, short oda );
  42.      int  EndRpDl ( char* stmt, short opr );
  43.      int  BeginRep( short stmtID, short opt, short ida, short oda )
  44.           { return BegRpDl( REPLACE_OPR, stmtID, opt, ida, oda ); };
  45.      int  EndRep( char* stmt )
  46.           { return EndRpDl( stmt, REPLACE_OPR ); };
  47.      int  BeginDel( short stmtID, short opt, short ida, short oda )
  48.           { return BegRpDl( DELETE_OPR, stmtID, opt, ida, oda ); };
  49.      int  EndDel( char* stmt )
  50.           { return EndRpDl( stmt, DELETE_OPR ); };
  51.  
  52.      int  BeginSetUpd( short stmtID, short opt, short ida, short oda )
  53.           { return BeginISU( SETUPD_OPR, stmtID, opt, ida, oda ); };
  54.      int  EndSetUpd( char* stmt )
  55.           { return EndSetIU( SETUPD_OPR, stmt ); };
  56.      int  BeginSetInq( short stmtID, short opt, short ida, short oda )
  57.           { return BeginISU( SETINQ_OPR, stmtID, opt, ida, oda ); };
  58.      int  EndSetInq( char* stmt )
  59.           { return EndSetIU( SETINQ_OPR, stmt ); };
  60.  
  61.      int  BeginScan();
  62.      int  EndScan();
  63.      int  Close();
  64.  
  65.      int  BeginSQLExec( short stmtID, short opt, short ida, short oda );
  66.      int  EndSQLExec( char* stmt );
  67.  
  68.      int  SetParm( unsigned short parmNum,
  69.                    Item&  dte,
  70.                    short int sqlType );
  71.  
  72.      int  BindCol( unsigned short parmNum,
  73.                    Item&  dte,
  74.                    short int sqlType );
  75.  
  76.      short GetCursorID();
  77.      void  EndAppOnInvalidCursorID();
  78.  
  79.      int  Err();
  80.      int  Hrd();
  81.      int  Nrf();
  82.      int  Dup();
  83.      int  Ded();
  84.      int  Unq();
  85.  
  86.      int  Lok();                             // followings not supported by SQL:
  87.      int  Eof();                             //     always return False!!!
  88.      int  Ful();
  89.      int  Fmt();
  90.      int  Fnf();
  91.      int  Fna();
  92.  
  93.      char*  Name() { return recName;} ;      // return name of SQL row  @0001
  94.  
  95.    private:
  96.      char*           pAppName;               // application Name
  97.      FCWString       recName;                // name of SQL row
  98.      void*           pSQLCA;                 // ptr to appl SQLCA
  99.      void*           pStmtObj;               // statement handle
  100.      char*           pSqlStmt;               // SQL statement for Prep/Exec
  101.      unsigned short  ioStatus;               // database I/O status
  102.      int             currStmtID;             // current statement id
  103.  
  104.      void*           pImpData;               // filler space
  105.      FCWXOITF*       pDbDrv;
  106.  
  107.      void  IOErrorHandling( FCWXOCIB *pCIB, int msgno );
  108.  
  109. };
  110.  
  111.  
  112. // -------------------------------------------------------------------
  113. //  Function:  Dummy SQL row for SQLEXEC process option without
  114. //             a process object
  115. // -------------------------------------------------------------------
  116. struct rcdEZEOSQR : public FCWOSQR
  117. {
  118.    rcdEZEOSQR() : FCWOSQR( "EZEOSQR", 0 ) {};
  119. };
  120.  
  121.  
  122. class FCWODBO : public FCWDBOBJ
  123. {
  124.   public:
  125.     FCWODBO();
  126.    ~FCWODBO();
  127.  
  128.     int   EZEConnect( char* id, char* psw, char* dbname, char* product,
  129.                       char* release, char* uow, void* pCA );
  130.     int   Commit( int option );
  131.     int   RollBack( int option );
  132.     int   Close( char opt );
  133.     void* Register( void* p);
  134.     int   DeRegister( void* p );
  135.     void  SetIO( Bool f );
  136.     Bool  IOPending();
  137.     void  SaveOpenCursor( char* App, char* Rec, short CursorID, Bool bWithHold );
  138.     void  GetOpenCursor( char* App, char* Rec, short& cursor, Bool& bWithHold );
  139.     InitValue  DbmType();
  140.     int   DftDBConnect( void* pCA );   // connect to database
  141.  
  142.     FCWXOITF* GetDrv();
  143.     int  SwitchSFDB ( SFDBValue newDB );                          // PQ01395
  144.     Bool FileSystemIsManagedByDB2();                              // PQ01395
  145.     void SetDBNameForNextSQLIO( char* n );
  146.  
  147.     Bool DriverExists();                                          // PQ19733
  148.  
  149.   private:
  150.     FCWXOITF* pDbDrv;
  151. };
  152.  
  153. #endif
  154.