home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / sybase / starbuck / hpp.z / wsqlconn.hpp < prev    next >
C/C++ Source or Header  |  1996-11-15  |  2KB  |  61 lines

  1. #ifndef _WSQLCONN_HPP_INCLUDED
  2. #define _WSQLCONN_HPP_INCLUDED
  3.  
  4. #ifndef _WTRANSAC_HPP_INCLUDED
  5. #include "wtransac.hpp"
  6. #endif
  7. #ifndef _WQUERY_HPP_INCLUDED
  8. #include "wquery.hpp"
  9. #endif
  10.  
  11. class WSQLTable : public WObject {
  12.     WDeclareSubclass ( WSQLTable, WObject );
  13.     public:
  14.         WString         owner;
  15.         WString         name;
  16.         WString         type;
  17. };
  18.  
  19. class WSQLColumn : public WObject {
  20.     WDeclareSubclass ( WSQLColumn, WObject );
  21.     public:
  22.         ~WSQLColumn() { delete [] data; }
  23.         WString         name;
  24.         char            *data;
  25.         long            size;
  26.         long            max_size;
  27.         long            got_size;
  28. };
  29.  
  30. class WCMCLASS WSQLConnection : public WObject
  31. {
  32.     WDeclareSubclass ( WSQLConnection, WObject );
  33.     public:
  34.         WBool Open( WString dbname, WString userid, WString password, WString connectparms = "", WString dbms = "" );
  35.         WBool Close();
  36.         WBool EnumTables( WVector< WSQLTable > &, WString table_pattern = "%",
  37.                           WString owner_pattern = "%", WString type = "" );
  38.         WBool OpenCursor( WString query );
  39.         WBool CloseCursor();
  40.         WBool BindColumns( WVector< WSQLColumn > &columns );
  41.         WBool Fetch();
  42.         WString GetError() { return( _message ); }
  43.         int GetRows() { return( _rows ); }
  44.         // TODO: Fix Error() to Call error message
  45. #if 0
  46.         void Error( void );
  47. #endif
  48.  
  49.         void SetParameter( int, WDataValue const & );
  50.         WString GetParameter( int );
  51.         void InitParameters();
  52.  
  53.     private:
  54.         WTransaction            _transact;
  55.         WQuery                  _query;
  56.         WString                 _message;
  57.         int                     _rows;
  58. };
  59.  
  60. #endif
  61.