Setting TimesTen Connection Attributes in ODP.NET Connection Strings
You can set TimesTen connection attributes within the Password
setting of your ODP.NET connection string.
The syntax is as follows:
-
Components of the
Password
setting, including the password setting itself and any TimesTen connection attribute settings, are delimited by semi-colons. -
Whenever the
Password
setting has semi-colons, the entire setting must be quoted. -
Because the ODP.NET connection string as a whole is quoted, the begin quotation mark and end quotation mark of the
Password
setting must each be preceded by the "\
" escape character.
The following example specifies lion
as the password for user scott
in TimesTen. It also sets the TimesTen OraclePWD
connection attribute, which specifies the password tiger
for user scott
in Oracle Database, for cache operations.
"Data Source=mysource;User Id=scott;Password=\"lion;OraclePwd=tiger\"";
The next example again specifies lion
as the password for scott
in TimesTen. This time, it sets the TimesTen OracleNetServiceName
connection attribute as well as the OraclePWD
connection attribute. OracleNetServiceName
specifies the Oracle ID in Oracle Database, with the OraclePWD
setting specifying the corresponding password tiger
. Finally, this example sets the TimesTen passthrough level to 1.
"Data Source=mysource;User ID=scott;Password=\"lion;OraclePwd=tiger;
OracleNetServiceName=mytest-pc.example.com;passthrough=1\"";
(For general information about TimesTen connection attributes, refer to Connection Attributes in Oracle TimesTen In-Memory Database Reference.)
Note:
As always, you can also set TimesTen connection attributes in your TimesTen DSN definition in ODBC Data Source Administrator, as shown in Managing TimesTen Databases in Oracle TimesTen In-Memory Database Operations
Guide. This is not secure, however, so is not advisable for password settings such as the OraclePWD
attribute.