home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 October / Chip_1997-10_cd.bin / tema / sybase / powerj / hpp.z / wsqlconn.hpp < prev    next >
C/C++ Source or Header  |  1996-12-04  |  2KB  |  62 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.     public:
  13.         WString         owner;
  14.         WString         name;
  15.         WString         type;
  16. };
  17.  
  18. class WSQLColumn : public WObject {
  19.     public:
  20.         ~WSQLColumn() { delete [] data; }
  21.         WString         name;
  22.         char            *data;
  23.         long            size;
  24.         long            max_size;
  25.         long            got_size;
  26. };
  27.  
  28. extern template WVector<WSQLTable>;
  29. extern template WVector<WSQLColumn>;
  30.  
  31. class WCMCLASS WSQLConnection : public WObject
  32. {
  33.     WDeclareSubclass ( WSQLConnection, WObject );
  34.     public:
  35.         WBool Open( WString dbname, WString userid, WString password, WString connectparms = "", WString dbms = "" );
  36.         WBool Close();
  37.         WBool EnumTables( WVector<WSQLTable> &, WString table_pattern = "%",
  38.                           WString owner_pattern = "%", WString type = "" );
  39.         WBool OpenCursor( WString query );
  40.         WBool CloseCursor();
  41.         WBool BindColumns( WVector<WSQLColumn> &columns );
  42.         WBool Fetch();
  43.         WString GetError() { return( _message ); }
  44.         int GetRows() { return( _rows ); }
  45.         // TODO: Fix Error() to Call error message
  46. #if 0
  47.         void Error( void );
  48. #endif
  49.  
  50.         void SetParameter( int, WDataValue const & );
  51.         WString GetParameter( int );
  52.         void InitParameters();
  53.  
  54.     private:
  55.         WTransaction            _transact;
  56.         WQuery                  _query;
  57.         WString                 _message;
  58.         int                     _rows;
  59. };
  60.  
  61. #endif
  62.