PTLib  Version 2.18.8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
podbc.h
Go to the documentation of this file.
1 /*
2  * podbc.h
3  *
4  * Virteos ODBC Implementation for PWLib Library.
5  *
6  * Virteos is a Trade Mark of ISVO (Asia) Pte Ltd.
7  *
8  * Copyright (c) 2005 ISVO (Asia) Pte Ltd. All Rights Reserved.
9  *
10  * The contents of this file are subject to the Mozilla Public License
11  * Version 1.0 (the "License"); you may not use this file except in
12  * compliance with the License. You may obtain a copy of the License at
13  * http://www.mozilla.org/MPL/
14  *
15  * Software distributed under the License is distributed on an "AS IS"
16  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
17  * the License for the specific language governing rights and limitations
18  * under the License.
19  *
20  *
21  * The Original Code is derived from and used in conjunction with the
22  * pwlib Libaray of the OpenH323 Project (www.openh323.org/)
23  *
24  * The Initial Developer of the Original Code is ISVO (Asia) Pte Ltd.
25  *
26  * Portions: Simple ODBC Wrapper Article www.codeproject.com
27  *
28  * Contributor(s): ______________________________________.
29  */
30 
89 //--
90 
91 #ifndef PTLIB_PODBC_H
92 #define PTLIB_PODBC_H
93 
94 #if _MSC_VER > 1000
95 #pragma once
96 #endif // _MSC_VER > 1000
97 
98 
99 #if P_ODBC
100 
101 #include <ptclib/vartype.h>
102 
103 
114 class PODBC : public PObject
115 {
116  PCLASSINFO(PODBC, PObject);
117  public:
122  PODBC();
123 
126  ~PODBC();
128 
130  typedef unsigned RowIndex;
131  enum { UndefinedRowIndex = 0 };
132 
133  class Field;
134  class Row;
135  class RecordSet;
136  class Statement; // Internal use
137  struct FieldExtra; // Internal use
138 
139 
142  class Field : public PVarType
143  {
144  PCLASSINFO(Field, PObject);
145  public:
146  ~Field();
147 
148  Field & operator=(const Field & other) { PVarType::operator=(other); return *this; }
149  Field & operator=(const PVarType & other) { PVarType::operator=(other); return *this; }
150 
151  // Overrides from PVarType, make sure can't change type
152  virtual bool SetType(BasicType type, PINDEX options = 0);
153 
156  void SetDefaultValues();
157 
160  void SetNULL();
161 
163  bool IsNULL() const;
164 
166  PINDEX GetColumn() const { return m_column; }
167 
169  const PString GetName() const { return m_name; }
170 
171  int GetDataType() const { return m_odbcType; }
172  unsigned GetScale() const { return m_scale; }
173  bool IsNullable() const { return m_isNullable; }
174  bool IsReadOnly() const { return m_isReadOnly; }
175  bool IsUpdatable() const { return !IsReadOnly(); }
176  bool IsAutoIncrement() const { return m_isAutoIncrement; }
177  bool IsAutoIndex() { return IsAutoIncrement(); }
178  unsigned GetPrecision() const { return m_decimals; }
179 
180  // For backward compatibility
181  bool Post();
182 
183  protected:
184  Field(Row & row, PINDEX column);
185 
186  // Call backs from PVarType
187  virtual void OnGetValue();
188  virtual void OnValueChanged();
189  virtual void InternalCopy(const PVarType & other);
190 
191  Row & m_row;
192  PINDEX m_column;
193 
196  unsigned m_scale;
200  unsigned m_decimals;
201 
202  FieldExtra * m_extra; // Some types are not compatible with PVarType
203 
204  private:
205  Field(const Field & other) : PVarType(), m_row(other.m_row) { }
206 
207  friend class Row;
208  friend class RecordSet;
209  };
210 
211 
219  class Row : public PObject
220  {
221  PCLASSINFO(Row, PObject);
222  public:
226  Row(RecordSet & recordSet);
227 
230  PINDEX Columns() const { return m_fields.GetSize(); }
231 
234  PStringArray ColumnNames() const;
235 
239  PINDEX ColumnByName(const PCaselessString & columnName) const;
240 
244  Field & Column(PINDEX column) const;
245 
248  Field & Column(const PString & name) const;
249 
252  Field & operator[](PINDEX column) const { return Column(column); }
253 
256  Field & operator[](const PString & columnName) const { return Column(columnName); }
257 
260  PString ColumnName(PINDEX column) const { return Column(column).GetName(); }
261 
264  unsigned ColumnType(PINDEX column) const { return Column(column).GetDataType(); }
265 
268  PINDEX ColumnSize(PINDEX column) const { return Column(column).GetSize(); }
269 
272  unsigned ColumnScale(PINDEX column) const { return Column(column).GetScale(); }
273 
278  unsigned ColumnPrecision(PINDEX column) const { return Column(column).GetPrecision(); }
279 
282  bool IsColumnNullable(PINDEX column) const { return Column(column).IsNullable(); }
283 
286  bool IsColumnUpdatable(PINDEX column) const { return Column(column).IsUpdatable(); }
287 
290  bool IsColumnAutoIndex(PINDEX column) const { return Column(column).IsAutoIndex(); }
292 
295  void SetNewRow();
296 
299  bool MoveTo(RowIndex row);
300 
303  bool Move(int offset);
304 
307  bool First();
308 
311  bool Next();
312 
315  bool Previous();
316 
319  bool Last();
320 
324  bool Delete(RowIndex rowIndex = 0);
325 
332  bool Commit();
333 
334  RowIndex GetRowIndex() const { return m_rowIndex; }
335 
336  // For backward compatibility
337  PINDEX Rows();
338  PINDEX ColumnCount() { return Columns(); }
339  bool PostNew() { return Commit(); }
340  bool PostUpdate() { return Commit(); }
341  bool Post() { return Commit(); }
342  bool Navigate(RowIndex row) { return MoveTo(row); }
343 
344  protected:
348 
349  private:
350  Row(const Row & other) : PObject(other), m_recordSet(other.m_recordSet) { }
351  void operator=(const Row &) { }
352 
353  friend class Field;
354  friend class RecordSet;
355  };
357 
358 
362  class RecordSet : public PObject
363  {
364  PCLASSINFO(RecordSet, PObject);
365  public:
372  RecordSet(PODBC & odbc, const PString & query = PString::Empty());
373 
374  // For backward compatibility
375  RecordSet(PODBC * odbc, const PString & query);
376 
378  ~RecordSet();
380 
386  bool Query(const PString & query);
387 
390  bool Select(
391  const PString & table,
392  const PString & whereClause = PString::Empty(),
393  const PString & fields = PString::Empty(),
394  const PString & orderedBy = PString::Empty(),
395  bool descending = false
396  );
397 
402  RowIndex Rows(bool forceCount = true);
403 
406  PINDEX Columns() { return m_cursor.Columns(); }
407 
410  PString ColumnName(PINDEX column) { return m_cursor.ColumnName(column); }
411 
415 
418  Row & NewRow();
419 
422  bool MoveTo(RowIndex row) { return m_cursor.MoveTo(row); }
423 
426  bool Move(int offset) { return m_cursor.Move(offset); }
427 
430  bool First() { return m_cursor.First(); }
431 
434  bool Next() { return m_cursor.Next(); }
435 
438  bool Previous() { return m_cursor.Previous(); }
439 
442  bool Last() { return m_cursor.Last(); }
443 
446  bool DeleteRow(RowIndex row = 0);
447 
451  Row & operator[](PINDEX row);
452 
457  Field & operator()(RowIndex row, PINDEX col);
458 
462  Field & Column(PINDEX column) { return m_cursor.Column(column); }
463 
466  Field & Column(const PString & name) { return m_cursor.Column(name); }
467 
470  bool Commit() { return m_cursor.Commit(); }
472 
473  // For backward compatibility
474  bool Post() { return m_cursor.Commit(); }
475 
476  protected:
477  Statement * m_statement; // ODBC Fetched Statement Info
480 
481  private:
482  RecordSet(const RecordSet & other);
483  void operator=(const RecordSet &) { }
484 
485  friend class Field;
486  friend class Row;
487  };
488 
489  typedef RecordSet Table; // For backward compatibility
490 
491 
496  P_DECLARE_ENUM(DriverType,
497  DSN,
498  mySQL,
499  postgreSQL,
500  Oracle,
501  IBM_DB2,
502  MSSQL,
503  MSAccess,
504  Paradox,
505  Foxpro,
506  dBase,
507  Excel,
508  Ascii,
509  ConnectionString
510  );
511  static const char * GetDriverName(DriverType type);
512  friend std::ostream & operator<<(std::ostream & strm, DriverType type) { return strm << PODBC::GetDriverName(type); }
513 
514 
518  {
524  };
525 
533  struct ConnectData
534  {
535  ConnectData() : m_driver(DSN), m_port(0), m_exclusive(false), m_trusted(false), m_options(0) { }
536 
537  DriverType m_driver;
543  unsigned m_port;
544  bool m_exclusive;
545  bool m_trusted;
546  int m_options;
547  };
548 
556  bool Connect(const ConnectData & connectInfo);
557 
562  bool Connect(
563  const PString & source
564  );
565 
572  bool Connect(
573  const PString & source,
574  const PString & username,
575  const PString & password
576  );
577 
580  bool Connect_DB2(
581  const PFilePath & dbPath
582  );
583 
586  bool Connect_XLS(
587  const PFilePath & xlsPath,
588  const PString & defDir = PString::Empty()
589  );
590 
593  bool Connect_TXT(
594  const PFilePath & txtPath
595  );
596 
599  bool Connect_FOX(
600  const PFilePath & dbPath,
601  const PString & user = PString::Empty(),
602  const PString & pass = PString::Empty(),
603  const PString & type = "DBF",
604  bool exclusive = false
605  );
606 
609  bool Connect_MDB(
610  const PFilePath & mdbPath,
611  const PString & user = PString::Empty(),
612  const PString & pass = PString::Empty(),
613  bool exclusive = false
614  );
615 
618  bool Connect_PDOX(
619  const PDirectory & dbPath,
620  const PDirectory & defaultDir,
621  int version = 5
622  );
623 
626  bool Connect_Oracle(
627  const PString & server,
628  const PString & user = PString::Empty(),
629  const PString & pass = PString::Empty());
630 
633  bool Connect_DBASE(
634  const PDirectory & dbPath
635  );
636 
639  bool Connect_MSSQL(
640  const PString & user = PString::Empty(),
641  const PString & pass = PString::Empty(),
642  const PString & host = "(local)",
643  bool trusted = true,
645  );
646 
649  bool Connect_mySQL(
650  const PString & user = PString::Empty(),
651  const PString & pass = PString::Empty(),
652  const PString & host = "localhost",
653  int port = 3306
654  );
655 
658  bool ConnectDB_mySQL(
659  const PString & db,
660  const PString & user = PString::Empty(),
661  const PString & pass = PString::Empty(),
662  const PString & host = "localhost",
663  int port = 3306
664  );
665 
668  bool Connect_postgreSQL(
669  const PString & db,
670  const PString & user,
671  const PString & pass,
672  const PString & host,
673  int port = 5432
674  );
675 
678  bool IsConnected() const;
679 
682  virtual void OnConnected();
683 
686  void Disconnect();
687 
693  bool withAttributes = true
694  ) const;
695 
701  bool system = false,
702  bool withDescription = true
703  ) const;
705 
713  PStringArray TableList(const PString & options = PString::Empty());
714 
720  bool Execute(const PString & sql);
721 
722  // For backward compatibility
723  __inline bool Query(const PString & sql) { return Execute(sql); }
725 
726 
732  static PString GetFieldType(DriverType driver, PVarType::BasicType type, unsigned size = 0);
733 
740  void SetPrecision(unsigned precision);
741 
742  unsigned GetPrecision() const { return m_precision; }
743 
746 
749 
752 
760 
762  int GetLastError() const { return m_lastError; }
763 
766 
769  virtual void OnSQLError(
770  int native,
771  const PString & code,
772  const PString & message
773  );
775 
776  // For backward compatibility
777  bool DataSource(DriverType driver, ConnectData Data);
778 
779  protected:
780  struct Link;
781 
782  Link * m_link;
785  unsigned m_precision;
791 
792  P_REMOVE_VIRTUAL_VOID(OnSQLError(const PString &, const PString &));
793 
794  friend class Statement;
795 };
796 
797 
798 // For backward compatibility
802 
803 
804 #endif // P_ODBC
805 
806 #endif // PTLIB_PODBC_H
807 
808 
809 // End Of File ///////////////////////////////////////////////////////////////
int GetLastError() const
Get last error.
Definition: podbc.h:762
PODBC()
Constructs ODBC connection.
bool IsNULL() const
Is curreently NULL value.
bool Connect(const ConnectData &connectInfo)
Connect to database using ConnectData This is the main function to call to contact a DataSource...
bool First()
First record.
Definition: podbc.h:430
RowIndex Rows(bool forceCount=true)
Returns the Number of Rows in the Resultant RecordSet.
static const char * GetDriverName(DriverType type)
Row & m_row
Definition: podbc.h:191
Field(Row &row, PINDEX column)
PDirectory m_directory
Used with Paradox/DBase/Excel (&amp; mySQL db)
Definition: podbc.h:539
PStringList GetDrivers(bool withAttributes=true) const
Get a list of driver descriptions and attributes.
PINDEX Columns()
Columns.
Definition: podbc.h:406
void SetPrecision(unsigned precision)
Set the Number of Decimal places to round to By Default it is 4.
bool m_isNullable
Definition: podbc.h:197
~PODBC()
Destroys ODBC connection.
unsigned GetPrecision() const
Definition: podbc.h:178
PODBC::Row POBDCRecord
Definition: podbc.h:800
unsigned ColumnScale(PINDEX column) const
Column Scale.
Definition: podbc.h:272
int m_options
General Option Value.mySQL &amp; Paradox.
Definition: podbc.h:546
PINDEX GetColumn() const
Get column index number, 1 up.
Definition: podbc.h:166
bool Navigate(RowIndex row)
Definition: podbc.h:342
bool IsConnected() const
Return true if connected.
bool ConnectDB_mySQL(const PString &db, const PString &user=PString::Empty(), const PString &pass=PString::Empty(), const PString &host="localhost", int port=3306)
Connect to a mySQL Server&#39;s specified DataBase.
virtual void OnSQLError(int native, const PString &code, const PString &message)
OnSQL Error.
unsigned m_decimals
Definition: podbc.h:200
bool Previous()
Previous record.
PStringArray ColumnNames() const
Retrieve the Column Names.
bool IsColumnAutoIndex(PINDEX column) const
IsColumnAutoIndex (ie don&#39;t give default Value)
Definition: podbc.h:290
__inline bool Query(const PString &sql)
Definition: podbc.h:723
bool m_trusted
Whether Datasource is trusted.
Definition: podbc.h:545
Row & NewRow()
Add New Row.
void SetNULL()
Set value to NULL.
ODBC Support for PWLIB.
Definition: podbc.h:114
bool Move(int offset)
Move to row relative to current position.
Definition: podbc.h:426
bool MoveTo(RowIndex row)
Move to Specified Row.
Definition: podbc.h:422
bool IsColumnNullable(PINDEX column) const
IsColumn Nullable.
Definition: podbc.h:282
bool IsReadOnly() const
Definition: podbc.h:174
PINDEX ColumnByName(const PCaselessString &columnName) const
ColumnByName returns the column number of the column name If not found returns column value of 0; ...
This class describes a full description for a file on the particular platform.
Definition: filepath.h:61
PArray< Field > m_fields
Current row number, starting at 1, 0 == new.
Definition: podbc.h:347
virtual void OnConnected()
Call back on successful connection.
RecordSet & m_recordSet
Definition: podbc.h:345
bool Connect_DB2(const PFilePath &dbPath)
Connect to IBM DB2 DataSource.
PODBC PDSNConnection
Definition: podbc.h:801
PString m_username
UID.
Definition: podbc.h:540
PODBC::RecordSet This is the main Class to access Data returned by a Select Query.
Definition: podbc.h:362
bool Connect_FOX(const PFilePath &dbPath, const PString &user=PString::Empty(), const PString &pass=PString::Empty(), const PString &type="DBF", bool exclusive=false)
Connect to a Foxpro dataSource.
This class is a variation of a string that ignores case.
Definition: pstring.h:2012
bool IsColumnUpdatable(PINDEX column) const
IsColumn Updateable ie is not ReadOnly.
Definition: podbc.h:286
int GetDataType() const
Definition: podbc.h:171
Definition: podbc.h:521
RowIndex GetRowIndex() const
Definition: podbc.h:334
PINDEX Columns() const
Columns.
Definition: podbc.h:230
PStringArray TableList(const PString &options=PString::Empty())
Retrieve a List of Tables in the Datasource use the option field to specify the type of data to acce...
Definition: podbc.h:519
virtual bool SetType(BasicType type, PINDEX options=0)
bool IsUpdatable() const
Definition: podbc.h:175
This is an array collection class of PString objects.
Definition: pstring.h:2365
bool m_isReadOnly
Definition: podbc.h:198
Row m_cursor
Definition: podbc.h:479
bool Connect_TXT(const PFilePath &txtPath)
Connect to an ascii text or cvs file.
bool m_exclusive
Whether Datasource is locked.
Definition: podbc.h:544
unsigned ColumnPrecision(PINDEX column) const
ColumnPrecision Get the Number of Decimal places if Precision is set the precision is set to the les...
Definition: podbc.h:278
PINDEX ColumnCount()
Definition: podbc.h:338
PString m_password
Password.
Definition: podbc.h:541
PODBC::Statement PODBCStmt
Definition: podbc.h:799
Definition: podbc.h:523
TimeFormat
Standard time formats for string representations of a time and date.
Definition: ptime.h:433
Field & operator=(const PVarType &other)
Definition: podbc.h:149
bool Previous()
Previous record.
Definition: podbc.h:438
PString m_host
Host name to connect to source.
Definition: podbc.h:542
virtual void InternalCopy(const PVarType &other)
Class to represent a directory in the operating system file system.
Definition: pdirect.h:173
bool Query(const PString &query)
Set the SQL query for this record set.
PINDEX Rows()
Field & Column(PINDEX column) const
Retrieve Field Data given the specifed column.
PString ColumnName(PINDEX column) const
Column Name.
Definition: podbc.h:260
void SetNewRow()
Make this row a new one.
bool Next()
Next record.
PINDEX ColumnSize(PINDEX column) const
Column Size.
Definition: podbc.h:268
void SetDateTimeFormat(PTime::TimeFormat fmt)
Definition: podbc.h:751
PTime::TimeFormat m_timeFormat
Double Real Float Decimal digit rounding def= 4;.
Definition: podbc.h:786
int m_lastError
Definition: podbc.h:783
unsigned RowIndex
Type for row index, may become 64 bit one day.
Definition: podbc.h:130
bool PostUpdate()
Definition: podbc.h:340
DriverType m_driver
Driver type.
Definition: podbc.h:537
Definition: podbc.h:131
bool First()
First record.
This class is a multipurpose use class for storing parameters when initiating connection to DataSour...
Definition: podbc.h:533
Class for Field Data.
Definition: podbc.h:142
Link * m_link
Definition: podbc.h:780
Field & operator()(RowIndex row, PINDEX col)
Returns the Field data at a predetermined position in the Resultant RecordSet.
PINDEX m_column
Back Reference to the Row.
Definition: podbc.h:192
PINDEX GetMaxChunkSize() const
Maximum size of an individual chunk of data.
Definition: podbc.h:759
bool Commit()
Post the Row back to the Database.
static PString GetFieldType(DriverType driver, PVarType::BasicType type, unsigned size=0)
Get valid field type for PVarType enumeration.
bool Last()
Last record.
bool Post()
Definition: podbc.h:474
RecordSet Table
Definition: podbc.h:489
bool Execute(const PString &sql)
Added Information to the DataSource.
FieldExtra * m_extra
Number of decimal places to Round.
Definition: podbc.h:202
PTime::TimeFormat GetDateFormat() const
Definition: podbc.h:747
#define P_MAX_INDEX
Definition: object.h:80
virtual void OnValueChanged()
const PString GetName() const
Get column name.
Definition: podbc.h:169
void SetDateFormat(PTime::TimeFormat fmt)
Definition: podbc.h:748
Field & Column(PINDEX column)
Returns the indicated Column Holder for the RecordSet, This can be used for iterative Row calls...
Definition: podbc.h:462
Definition: podbc.h:522
bool Connect_PDOX(const PDirectory &dbPath, const PDirectory &defaultDir, int version=5)
Connect to a paradox database datastore.
The character string class.
Definition: pstring.h:108
unsigned GetPrecision() const
Definition: podbc.h:742
unsigned m_port
Port to connect to source.
Definition: podbc.h:543
bool IsNullable() const
Definition: podbc.h:173
Field & operator[](PINDEX column) const
Retrieve Field Data given specified column.
Definition: podbc.h:252
bool IsAutoIncrement() const
Definition: podbc.h:176
bool DataSource(DriverType driver, ConnectData Data)
bool Connect_mySQL(const PString &user=PString::Empty(), const PString &pass=PString::Empty(), const PString &host="localhost", int port=3306)
Connect to a mySQL Server.
RowIndex m_totalRows
Definition: podbc.h:478
bool Move(int offset)
Move to row relative to current position.
virtual void OnGetValue()
P_REMOVE_VIRTUAL_VOID(OnSQLError(const PString &, const PString &))
bool Connect_Oracle(const PString &server, const PString &user=PString::Empty(), const PString &pass=PString::Empty())
Connect to an Oracle Datasource.
bool DeleteRow(RowIndex row=0)
Delete Row 0 indicates Current Row.
MSSQLProtocols
MSSQL protocols.If your interested?
Definition: podbc.h:517
This is a list collection class of PString objects.
Definition: pstring.h:2562
unsigned m_scale
Definition: podbc.h:196
Database Row Class This class functions as a simple wrapper of the Statement class to fetch/Save data...
Definition: podbc.h:219
PTime::TimeFormat GetTimeFormat() const
Definition: podbc.h:744
void SetTimeFormat(PTime::TimeFormat fmt)
Definition: podbc.h:745
PStringArray ColumnNames()
ColumnNames.
Definition: podbc.h:414
bool Connect_MSSQL(const PString &user=PString::Empty(), const PString &pass=PString::Empty(), const PString &host="(local)", bool trusted=true, MSSQLProtocols Proto=MSSQLNamedPipes)
Connect to a MS SQL Server.
static const PString & Empty()
Return an empty string.
void Disconnect()
General Disconnect from DataSource.
PTime::TimeFormat GetDateTimeFormat() const
Definition: podbc.h:750
bool m_isAutoIncrement
Definition: podbc.h:199
bool Connect_MDB(const PFilePath &mdbPath, const PString &user=PString::Empty(), const PString &pass=PString::Empty(), bool exclusive=false)
Connect to a MS Access *.mdb DataSource.
bool IsAutoIndex()
Definition: podbc.h:177
RecordSet(PODBC &odbc, const PString &query=PString::Empty())
Constructor Using the HDBC and TableName/Select SQL Query creates a virtual table in the OBDC driver...
RowIndex m_rowIndex
Definition: podbc.h:346
PTime::TimeFormat m_dateFormat
Definition: podbc.h:787
P_DECLARE_ENUM(DriverType, DSN, mySQL, postgreSQL, Oracle, IBM_DB2, MSSQL, MSAccess, Paradox, Foxpro, dBase, Excel, Ascii, ConnectionString)
Driver types that are supported by this implementation.
friend class Statement
Definition: podbc.h:794
Row(RecordSet &recordSet)
Constructor.
This template class maps the PArrayObjects to a specific object type.
Definition: array.h:925
bool Next()
Next record.
Definition: podbc.h:434
unsigned GetScale() const
Definition: podbc.h:172
bool Connect_postgreSQL(const PString &db, const PString &user, const PString &pass, const PString &host, int port=5432)
Connect to a postgreSQL Server.
PString ColumnName(PINDEX column)
Column Name.
Definition: podbc.h:410
Field & Column(const PString &name)
Returns the indicated Column Holder Name for the RecordSet,.
Definition: podbc.h:466
PString m_database
Database name or file Path (not Oracle,xxSQL)
Definition: podbc.h:538
bool Commit()
Commit data to record set.
Definition: podbc.h:470
bool MoveTo(RowIndex row)
Move to Specified Row.
bool Select(const PString &table, const PString &whereClause=PString::Empty(), const PString &fields=PString::Empty(), const PString &orderedBy=PString::Empty(), bool descending=false)
Set the SQL query to a SELECT for this record set.
bool Connect_DBASE(const PDirectory &dbPath)
Connect to a DBase DataStore.
unsigned ColumnType(PINDEX column) const
ColumnTypes.
Definition: podbc.h:264
Field & operator[](const PString &columnName) const
Retrieve Field Data given the column Name.
Definition: podbc.h:256
friend std::ostream & operator<<(std::ostream &strm, DriverType type)
Definition: podbc.h:512
bool m_needChunking
Definition: podbc.h:789
PTime::TimeFormat m_dateTimeFormat
Definition: podbc.h:788
int m_odbcType
Column Name.
Definition: podbc.h:195
~RecordSet()
Destroy the record set and free resources used.
PString GetLastErrorText() const
Get last error text.
Definition: podbc.h:765
PString m_lastErrorText
Definition: podbc.h:784
Ultimate parent class for all objects in the class library.
Definition: object.h:2204
bool Connect_XLS(const PFilePath &xlsPath, const PString &defDir=PString::Empty())
Connect to MS Office excel spreadsheet.
bool PostNew()
Definition: podbc.h:339
bool Post()
Definition: podbc.h:341
Statement * m_statement
Definition: podbc.h:477
void SetDefaultValues()
Initialise/Set the Default values for Field of New Record.
PStringList GetSources(bool system=false, bool withDescription=true) const
Get a list of known data sources and their descriptions The returned strings when withDescription tru...
unsigned m_precision
Definition: podbc.h:785
Definition: podbc.h:520
Row & operator[](PINDEX row)
Row return the fetched row in the Cached RecordSet.
bool Last()
Last record.
Definition: podbc.h:442
PINDEX m_maxChunkSize
Definition: podbc.h:790
bool Delete(RowIndex rowIndex=0)
Delete the Current Record from the RecordSet
PString m_name
Column number.
Definition: podbc.h:194
Field & operator=(const Field &other)
Definition: podbc.h:148
ConnectData()
Definition: podbc.h:535