public class DBCSQLConnectionTarget
extends java.lang.Object
You create one instance of this class for each database you wish to connect to. Pass the details of the database to the constructor.
Creating this object does not actually connect to the database. To use this object, create a DBCSQLQuery and pass this object as a parameter - the query will first try to obtain an existing database connection associated with the same target, failing which it will create a new connection.
In general, the first such created target in a jvm is used as the default, i.e.,
its used by DBCSQLQuery objects created using the no-argument constructor.
Note that plugins do not use the default target - the object returned by
DBCDBPlugin_3.init(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
is used by the Database Connector - only DBCSQLQuery
objects that you create manually with the no-arg constructor will use the default database.
Do not create unnecessary instances of this object, or multiple instances of it for one database - it can cause the connection pool to open a large number of database connections.
Note that it is possible that the target object you return may not be the same object that is obtained by calling other functions. This is because this object is only a wrapper for the internal system-level object - the multiple wrappers will all internally refer to the same system-level object.
Note that a target cannot be modified once created. It also cannot be destroyed, since there may exist connections within the connection pool that refer to the target - the process needs to be restarted to destroy all connections.
Note that the JDBC api has no equivalent for this class.
Constructor and Description |
---|
DBCSQLConnectionTarget(java.lang.String paName,
java.lang.String ConnectionStr,
java.lang.String UserName,
java.lang.String Password,
java.lang.String databaseType)
The constructor for developers to create this object.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getConnectionString()
Returns the value provided to the constructor.
|
I_djSQLConnectionTarget |
getInternalTarget()
Developers must not call this function.
|
java.lang.String |
getName()
Returns the name provided to the constructor.
|
java.lang.String |
getPassword()
Returns the value provided to the constructor.
|
java.lang.String |
getUserName()
Returns the value provided to the constructor.
|
public DBCSQLConnectionTarget(java.lang.String paName, java.lang.String ConnectionStr, java.lang.String UserName, java.lang.String Password, java.lang.String databaseType)
paName
- Any name you wish to provide for this database. It is used only
in logs and error messages.ConnectionStr
- The jdbc connect string to connect to the database. For example,
Oracle databases will use "jdbc:oracle:thin:@127.0.0.1:1521:ORCL" or similar.UserName
- The username or schema name on the database.Password
- The password corresponding to the username on the database.databaseType
- A string that indicates the type of database. Can be
one of
Note that the driver registration is performed automatically. This does not mean that the driver is included - see the 'jdbc' directory in your database connector installation for installed drivers.
Note that these are currently the only databases supported by the connection pool. Should you require support for a different database, contact support.
public I_djSQLConnectionTarget getInternalTarget()
public java.lang.String getName()
public java.lang.String getConnectionString()
public java.lang.String getUserName()
public java.lang.String getPassword()