| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Friends
TeSqlServer Class Reference

A driver class to an SQL Server database accessible using ADO library. More...

`#include <TeAdoSqlServer.h>`

Inheritance diagram for TeSqlServer:

List of all members.

## Public Member Functions

| TeSqlServer ()
| ~TeSqlServer ()
virtual bool | newDatabase (const string &database, const string &user, const string &password, const string &host, const int &port=-1, bool terralibModel=true, const std::string &characterSet="")
| Creates a new database and open a connection to it.
virtual bool | connect (const string &host, const string &user, const string &password, const string &database, int port=-1)
| Opens a connection to a database server passing all parameters needed.
virtual bool | tableExist (const string &table)
| Verifies if a table exist in the database.
virtual bool | columnExist (const string &table, const string &column, TeAttribute &attr)
| Verifies if a table has a column.
virtual bool | getAttributeList (const string &tableName, TeAttributeList &attList)
| Gets the list of attributes of a table.
virtual bool | createTable (const string &table, TeAttributeList &attr)
| Creates a table.
virtual bool | alterTable (const string &table, TeAttributeRep &rep, const string &oldColName="")
| Alter a property of a table.
virtual bool | alterTable (const string &oldTableName, const string &newTablename)
| Alter the table name.
virtual bool | addColumn (const string &table, TeAttributeRep &rep)
| Adds a column to a table.
virtual bool | deleteTable (const string &table)
| Deletes a table. Do not allow the deletion of model tables.
virtual bool | createRelation (const string &name, const string &table, const string &fieldName, const string &relatedTable, const string &relatedField, bool cascadeDeletion)
| Creates a reationship between two tables.
virtual bool | deleteLayer (int layerId)
| Delete a particular layer passing its id.
virtual bool | deleteTheme (int themeId)
| Erases the theme identified by themeId.
virtual bool | deleteView (int viewId)
| Delete a view.
virtual TeDBRelationType | existRelation (const string &tableName, const string &relName)
| Checks if a relation exist.
virtual bool | listDatabases (std::vector< std::string > &)
| Returns a lista of databases.
virtual bool | dropDatabase (const std::string &)
| Drop a database.
virtual bool | insertTable (TeTable &table)
| Saves a table and its contents in the database.
virtual bool | insertTheme (TeAbstractTheme *theme)
| Inserts an abstract theme in the database.
virtual bool | generateLabelPositions (TeTheme *theme, const std::string &objectId="")
| Generates the label position (x,y) to each object of a theme or of a particular object.
virtual bool | insertPolygonSet (const string &table, TePolygonSet &ps)
| Inserts a polygon set in a geometry table.
virtual bool | insertPolygon (const string &table, TePolygon &p)
| Inserts a polygon in a geometry table.
virtual bool | insertLineSet (const string &table, TeLineSet &ls)
virtual bool | insertLine (const string &table, TeLine2D &l)
virtual bool | insertPointSet (const string &table, TePointSet &ps)
virtual bool | insertPoint (const string &table, TePoint &p)
virtual bool | insertTextSet (const string &table, TeTextSet &ts)
virtual bool | insertText (const string &table, TeText &t)
virtual TeDatabasePortal * | getPortal ()
| Returns a database portal.
virtual string | getNameTrigger (const string &tableName)
virtual string | getSQLTime (const TeTime &time) const
| Gets the date and time following the format MMsDDsYYYYsHHsMMsSS to use with Access.
virtual string | toUpper (const string &value)
| Returns the SQL function for upper case.

## Friends

class | TeSqlServerPortal

## Detailed Description

A driver class to an SQL Server database accessible using ADO library.

## Constructor & Destructor Documentation

TeSqlServer::TeSqlServer | ( |  | ) |

TeSqlServer::~TeSqlServer | ( |  | ) |

## Member Function Documentation

bool TeSqlServer::addColumn | ( | const string & | table,
|  | TeAttributeRep & | rep
| ) |  | `[virtual]`

Adds a column to a table.

Parameters:

  table | table name
  rep | representation of the column being created

Reimplemented from TeAdo.

bool TeSqlServer::alterTable | ( | const string & | tableName,
|  | TeAttributeRep & | rep,
|  | const string & | oldColName = `""`
| ) |  | `[virtual]`

Alter a property of a table.

Reimplemented from TeAdo.

Reimplemented in TeSqlServerSpatial.

bool TeSqlServer::alterTable | ( | const string & | oldTableName,
|  | const string & | newTablename
| ) |  | `[virtual]`

Alter the table name.

Reimplemented from TeAdo.

bool TeSqlServer::columnExist | ( | const string & | table,
|  | const string & | column,
|  | TeAttribute & | attr
| ) |  | `[virtual]`

Verifies if a table has a column.

Reimplemented from TeAdo.

Reimplemented in TeSqlServerSpatial.

bool TeSqlServer::connect | ( | const string & | host,
|  | const string & | user,
|  | const string & | password,
|  | const string & | database,
|  | int | port = `-1`
| ) |  | `[virtual]`

Opens a connection to a database server passing all parameters needed.

Reimplemented from TeAdo.

Reimplemented in TeSqlServerSpatial.

bool TeSqlServer::createRelation | ( | const string & | relName,
|  | const string & | table,
|  | const string & | fieldName,
|  | const string & | relatedTable,
|  | const string & | relatedField,
|  | bool | cascadeDeletion
| ) |  | `[virtual]`

Creates a reationship between two tables.

Parameters:

  relName | relationship name
  table | table that will receive the foreign key
  fieldName | column that will be foreign key
  relatedTable | table that exports the foreign key
  relatedField | field that will the exported foreign key
  cascadeDeletion | flag that indicates if the deletion should be propagated

Reimplemented from TeAdo.

bool TeSqlServer::createTable | ( | const string & | table,
|  | TeAttributeList & | attr
| ) |  | `[virtual]`

Creates a table.

Parameters:

  table | table name
  attr | table list of attributes

Reimplemented from TeAdo.

Reimplemented in TeSqlServerSpatial.

bool TeSqlServer::deleteLayer | ( | int | layerId | ) | `[virtual]`

Delete a particular layer passing its id.

Reimplemented from TeDatabase.

bool TeSqlServer::deleteTable | ( | const string & | table | ) | `[virtual]`

Deletes a table. Do not allow the deletion of model tables.

Reimplemented from TeDatabase.

bool TeSqlServer::deleteTheme | ( | int | themeId | ) | `[virtual]`

Erases the theme identified by themeId.

Reimplemented from TeDatabase.

bool TeSqlServer::deleteView | ( | int | viewId | ) | `[virtual]`

Delete a view.

Reimplemented from TeDatabase.

bool TeSqlServer::dropDatabase | ( | const std::string & | databaseName | ) | `[virtual]`

Drop a database.

Reimplemented from TeDatabase.

TeDBRelationType TeSqlServer::existRelation | ( | const string & | tableName,
|  | const string & | relName
| ) |  | `[virtual]`

Checks if a relation exist.

Parameters:

  tableName | table where the relashionship exists
  relName | relationship name

Reimplemented from TeAdo.

bool TeSqlServer::generateLabelPositions | ( | TeTheme * | theme,
|  | const std::string & | objectId = `""`
| ) |  | `[virtual]`

Generates the label position (x,y) to each object of a theme or of a particular object.

Reimplemented from TeDatabase.

Reimplemented in TeSqlServerSpatial.

bool TeSqlServer::getAttributeList | ( | const string & | tableName,
|  | TeAttributeList & | attList
| ) |  | `[virtual]`

Gets the list of attributes of a table.

Reimplemented from TeAdo.

string TeSqlServer::getNameTrigger | ( | const string & | tableName | ) | `[virtual]`

TeDatabasePortal * TeSqlServer::getPortal | ( |  | ) | `[virtual]`

Returns a database portal.

A database portal is used to submit queries to the database and to navigate over the resulting record set

Reimplemented from TeAdo.

Reimplemented in TeSqlServerSpatial.

string TeSqlServer::getSQLTime | ( | const TeTime & | time | ) | const`[virtual]`

Gets the date and time following the format MMsDDsYYYYsHHsMMsSS to use with Access.

Reimplemented from TeAdo.

bool TeSqlServer::insertLine | ( | const string & | table,
|  | TeLine2D & | l
| ) |  | `[virtual]`

Reimplemented from TeAdo.

Reimplemented in TeSqlServerSpatial.

bool TeSqlServer::insertLineSet | ( | const string & | table,
|  | TeLineSet & | ls
| ) |  | `[virtual]`

Reimplemented from TeAdo.

Reimplemented in TeSqlServerSpatial.

bool TeSqlServer::insertPoint | ( | const string & | table,
|  | TePoint & | p
| ) |  | `[virtual]`

Reimplemented from TeAdo.

Reimplemented in TeSqlServerSpatial.

bool TeSqlServer::insertPointSet | ( | const string & | table,
|  | TePointSet & | ps
| ) |  | `[virtual]`

Reimplemented from TeAdo.

Reimplemented in TeSqlServerSpatial.

bool TeSqlServer::insertPolygon | ( | const string & | table,
|  | TePolygon & | p
| ) |  | `[virtual]`

Inserts a polygon in a geometry table.

Reimplemented from TeAdo.

Reimplemented in TeSqlServerSpatial.

bool TeSqlServer::insertPolygonSet | ( | const string & | table,
|  | TePolygonSet & | ps
| ) |  | `[virtual]`

Inserts a polygon set in a geometry table.

Reimplemented from TeAdo.

Reimplemented in TeSqlServerSpatial.

bool TeSqlServer::insertTable | ( | TeTable & | table | ) | `[virtual]`

Saves a table and its contents in the database.

Reimplemented from TeAdo.

bool TeSqlServer::insertText | ( | const string & | table,
|  | TeText & | t
| ) |  | `[virtual]`

Reimplemented from TeAdo.

Reimplemented in TeSqlServerSpatial.

bool TeSqlServer::insertTextSet | ( | const string & | table,
|  | TeTextSet & | ts
| ) |  | `[virtual]`

Reimplemented from TeAdo.

Reimplemented in TeSqlServerSpatial.

bool TeSqlServer::insertTheme | ( | TeAbstractTheme * | theme | ) | `[virtual]`

Inserts an abstract theme in the database.

Reimplemented from TeAdo.

bool TeSqlServer::listDatabases | ( | std::vector< std::string > & | databaseList | ) | `[virtual]`

Returns a lista of databases.

Reimplemented from TeDatabase.

bool TeSqlServer::newDatabase | ( | const string & | database,
|  | const string & | user,
|  | const string & | password,
|  | const string & | host,
|  | const int & | port = `-1`,
|  | bool | terralibModel = `true`,
|  | const std::string & | characterSet = `""`
| ) |  | `[virtual]`

Creates a new database and open a connection to it.

Reimplemented from TeAdo.

bool TeSqlServer::tableExist | ( | const string & | table | ) | `[virtual]`

Verifies if a table exist in the database.

Reimplemented from TeAdo.

string TeSqlServer::toUpper | ( | const string & | value | ) | `[virtual]`

Returns the SQL function for upper case.

Reimplemented from TeAdo.

## Friends And Related Function Documentation

friend class TeSqlServerPortal`[friend]`

The documentation for this class was generated from the following files:

- E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/drivers/ado/TeAdoSqlServer.h
- E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/drivers/ado/TeAdoSqlServer.cpp

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines