PyANGKernel.GKDataBaseInfo¶
- class GKDataBaseInfo¶
This class holds information about a database using in Aimsun Next.
Details
Some components of Aimsun can store data in external (to Aimsun database) databases. For example OD matrices (
GKODMatrixusing GKModel::setDatabase) or Aimsun Next Simulator statistical data. This class hold the information about the database to use.To ask Aimsun Model to use a ODBC database you will:
GKDataBaseInfo info; GKModel *model; info.setDatabaseName( "MY DATASOURCE NAME" ); info.setDriverName( "QODBC3" ); model->setDatabase( info );
The database can be automatic (false by default). In this case Aimsun Next will create and manage the database for the user without asking for a file. The supported automatic ones are
SQLite(MAC OS X, Linux, Windows) and Access (Windows). In Windows, the user can select the driver to use.Synopsis¶
Methods¶
def
__init__()def
clear()def
fromString()def
getDriverName()def
getHostName()def
getPassword()def
getPort()def
getUserName()def
isAutomatic()def
isComplete()def
isFileBased()def
isPostgresSQL()def
isSQLite()def
__ne__()def
__eq__()def
setAutomatic()def
setHostName()def
setPassword()def
setPort()def
setUserName()def
toString()def
useProjectDB()
Static functions¶
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
- __init__([urlStr=""])¶
- Parameters:
urlStr – str
- clear()¶
Reset this object.
Helper function: returns true if the given driver is file-based (currently Access and
SQLite))Helper function: returns true if the given driver needs server and login data (currently anything not being Access &
SQLite)- fromString(urlStr)¶
- Parameters:
urlStr – str
Parses the string and constructs the
GKDataBaseInfoobject. The string must be compliant with the format used bytoString()function.Type of database. Possible values are: - QODBC3 - QSQLITE - ACCESS - Any other supported by the installed Qt sqldrivers
Host name where the database is. Some databases do not require a host name (Access,
SQLite, ODBC connections to Access orSQLite).Password. Some databases do not require a password (Access for example). <b>Note:</b> password data is not encripted
TCP/IP port where the database listener is. Some databases do not require a port (Access,
SQLite, ODBC connections to Access orSQLite).Username. Some databases do not require a username (Access for example).
Automatic database? If so the name will be set from the model and will be created automatically
Create the database automatically using the current name (if
isAutomaticthe name will be set too)Checks if the object has all the required data to connect to the database. For file-based drivers, this means checking if the file is defined. For server-based driver, the server and login data are also mandatory.
- __ne__(src)¶
- Parameters:
src –
GKDataBaseInfo- Return type:
- __eq__(src)¶
- Parameters:
src –
GKDataBaseInfo- Return type:
For file based databases, checks whether a DB needs to be created automatically or not
- setAutomatic(value)¶
- Parameters:
value – bool
Automatic database?
See also
- setAutomaticallyCreated(value)¶
- Parameters:
value – bool
Create the database automatically using the current name (if
isAutomaticthe name will be set too)See also
- setDatabaseName(name)¶
- Parameters:
name – str
Database name. If using QODBC3, the datasource name. If Access or
SQLitethe file.- setHostName(host)¶
- Parameters:
host – str
Host name where the database is. Some databases do not require a host name (Access,
SQLite, ODBC connections for Access orSQLite).- setPassword(password)¶
- Parameters:
password – str
Password. Some databases do not require a password (Access for example). <b>Note:</b> password data is not encripted
- setPort(p)¶
- Parameters:
p – int
TCP/IP port where the database listener is. Some databases do not require a port (Access,
SQLite, ODBC connections to Access orSQLite).- setUseProjectDB(value)¶
- Parameters:
value – bool
If true, use the project DB instead of this DB
See also
- setUserName(name)¶
- Parameters:
name – str
User name. Some databases do not require a user name (Access for example).
Returns a string representation of this object as a URL. The format is the following: - For server-based DBs: “driver://user[:pass]@server:port/schema” - for file-based DB’s: “driver://user[:pass]@filepath”
UnknownCommandwithPasswd: if true, the password will also be included in the string
If true, use the project DB instead of this DB
See also