27 #include "../common/Exception.h" 
   28 #include "../common/Translator.h" 
   29 #include "../dataaccess/datasource/DataSourceTransactor.h" 
   30 #include "../dataaccess/query/SQLDialect.h" 
   31 #include "../datatype/StringProperty.h" 
   45 #include <boost/filesystem.hpp> 
   46 #include <boost/format.hpp> 
   47 #include <boost/lexical_cast.hpp> 
   78   m_connInfo = connInfo;
 
   95   _ConnectionPtr connection = conn->getConn();
 
   97   loadGeometryColumnsCache(connection);
 
  130   return m_geomColumns;
 
  134                                                  const std::string& geomColName)
 
  136   boost::lock_guard<boost::mutex> lock(m_mtx);
 
  138   m_geomColumns[datasetName] = geomColName;
 
  142                                            const std::string& colName)
 const 
  144   boost::lock_guard<boost::mutex> lock(m_mtx);
 
  146   std::map<std::string, std::string>::const_iterator it = m_geomColumns.find(datasetName);
 
  148   if(it != m_geomColumns.end())
 
  149     return it->second == colName;
 
  161   ADOX::_CatalogPtr pCatalog = 0;
 
  163   pCatalog.CreateInstance(__uuidof(ADOX::Catalog));
 
  167     pCatalog->Create(connInfo.c_str());
 
  174   std::map<std::string, std::string>::const_iterator it = dsInfo.find(
"CREATE_OGC_METADATA_TABLES");
 
  175   std::map<std::string, std::string>::const_iterator it_end = dsInfo.end();
 
  177   if(it != it_end && it->second == 
"TRUE")
 
  190     std::map<std::string, std::string> op;
 
  192     createDataSet(geomColsDt, op);
 
  203   std::map<std::string, std::string> info = dsInfo;
 
  205   boost::filesystem::path path(info[
"DB_NAME"]);
 
  207   if(boost::filesystem::remove(path) == 
false)
 
  213   std::map<std::string, std::string> info = dsInfo;
 
  215   boost::filesystem::path path(info[
"DB_NAME"]);
 
  217   return boost::filesystem::exists(path);
 
  222   return std::vector<std::string>(); 
 
  227   return std::vector<te::common::CharEncoding>(); 
 
  232   boost::lock_guard<boost::mutex> lock(m_mtx);
 
  234   m_geomColumns.clear();
 
  236   _RecordsetPtr recordset;
 
  238   TESTHR(recordset.CreateInstance(__uuidof(Recordset)));
 
  240   std::string query = 
"SELECT * FROM geometry_columns";
 
  244     recordset->Open(query.c_str(), _variant_t((IDispatch *)adoConn), adOpenDynamic, adLockReadOnly, adCmdText);
 
  246     while(!recordset->EndOfFile)
 
  248       std::string tablename = (LPCSTR)(_bstr_t)recordset->GetFields()->GetItem(
"f_table_name")->GetValue();
 
  250       std::string columnName = (LPCSTR)(_bstr_t)recordset->GetFields()->GetItem(
"f_geometry_column")->GetValue();
 
  252       m_geomColumns[tablename] = columnName;
 
  254       recordset->MoveNext();
 
The transactor class for the Microsoft Access driver. 
static te::da::DataSourceCapabilities * sm_capabilities
The query dialect supported by ADO driver. 
#define ADO_DRIVER_IDENTIFIER
The ADO driver identifier string. 
const te::da::DataSourceCapabilities & getCapabilities() const 
It returns the known capabilities of the data source. 
void drop(const std::map< std::string, std::string > &dsInfo)
It removes the data source with the connection information from a driver. 
An atomic property like an integer or double. 
bool isValid() const 
It checks if the data source is valid (available for using). 
A class that models the description of a dataset. 
void close()
It closes the data source and clears all the resources used by its internal communication channel...
bool exists(const std::map< std::string, std::string > &dsInfo)
Check the existence of a data source in a driver. 
It represents the SQL query dialect accepted by a given data source. 
A class that represents the known capabilities of a specific data source, i.e. this class informs all...
bool isOpened() const 
It returns true if the data source is opened, otherwise it returns false. 
std::string MakeConnectionStr(const std::map< std::string, std::string > &dsInfo)
Create a connection string based on a map. 
#define TE_TR(message)
It marks a string in order to get translated. 
std::vector< te::common::CharEncoding > getEncodings(const std::map< std::string, std::string > &dsInfo)
It gets the encodings for the data source. 
A class that implements a connection to a ADO database. 
const te::da::SQLDialect * getDialect() const 
It returns the data source SQL dialect, if there is one. 
static te::da::SQLDialect * sm_queryDialect
The query dialect supported by ADO driver. 
void registerGeometryColumn(const std::string &datasetName, const std::string &geomColName)
std::auto_ptr< te::da::DataSourceTransactor > getTransactor()
It returns an object that can execute transactions in the context of a data source. 
The type for string types: FIXED_STRING, VAR_STRING or STRING. 
const std::map< std::string, std::string > & getGeomColumns() const 
void create(const std::map< std::string, std::string > &dsInfo)
It creates a new data source. 
This class is designed to declare objects to be thrown as exceptions by TerraLib. ...
~DataSource()
Virtual destructor. 
Implementation of the data source class for the ADO driver. 
DataSourceTransactor class implementation for Microsoft Access driver. 
void add(Constraint *c)
It adds a new constraint. 
bool isGeometryColumn(const std::string &datasetName, const std::string &colName) const 
std::string getType() const 
It returns the data source type name (in UPPER CASE). Ex: POSTGIS, SQLITE, WFS, WMS, or MYSQL. 
Utility functions for ADO. 
A class that implements a connection to a ADO database. 
void setConnectionInfo(const std::map< std::string, std::string > &connInfo)
It sets the connection information to be used when connecting to the data source. ...
void loadGeometryColumnsCache(_ConnectionPtr &adoConn)
const std::map< std::string, std::string > & getConnectionInfo() const 
It returns the set of parameters used to set up the access channel to the underlying repository...
std::vector< std::string > getDataSourceNames(const std::map< std::string, std::string > &dsInfo)
It gets the data source names available in a driver. 
An static class with global definitions. 
void open()
It opens the data source and makes it ready for using.