国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > 綜合 > 正文

c#,oracle的連接字符串,sys用戶的解決辦法。

2024-07-21 02:26:43
字體:
來源:轉載
供稿:網友
system.data.oracleclient
oracleconnection.connectionstring 屬性
下表為 connectionstring 內的值列出了有效的名稱。

名稱默認值說明
數據源或服務器 要連接的oracle實例的名稱或網絡地址
集成安全性'false'該連接是否為安全的連接。
可識別的值為 true(極力建議使用)、falseyesno
密碼 oracle 帳戶的登錄密碼(建議不要使用。為了保持較高的安全級別,極力建議您改用集成安全性關鍵字。)
持續安全信息'false'當設置為 falseno(強烈建議)時,如果連接是打開的或者一直處于打開狀態的 state,那么安全敏感的信息(如密碼)就不會作為連接的一部分返回。重置連接字符串將重置包括密碼在內的所有連接字符串值。
unicode 指定用于 oracle 的.net framework 數據提供程序是否使用 utf16 模式 api 調用。除了未在 oracle 9i 客戶端軟件中使用分布式事務的情況以外,該關鍵字在其他情況下都會被忽略。當不使用 oracle 9i 客戶端軟件與 oracle 9i 服務器通信時,如果 unicode 設置為 true,可能發生不可預知的結果。
用戶 id oracle 登錄帳戶(建議不要使用。為了保持較高的安全級別,極力建議您改用集成安全性關鍵字。)

當設置需要布爾值的關鍵字或連接池值時,您可以使用 'yes' 代替 'true','no' 代替 'false'。整數值表示為字符串。

示例

[visual basic, c#, c++] 下面的示例創建一個 oracleconnection,并在連接字符串中設置它的一些屬性。
[visual basic] public sub createoracleconnection() dim myconnstring as string = _ "data source=oracle8i;integrated security=yes" dim myconnection as new oracleconnection(myconnstring) myconnection.open() messagebox.show("serverversion: " + myconnection.serverversion _ + controlchars.newline + "datasource: " + myconnection.datasource) myconnection.close()end sub[c#] public void createoracleconnection() { string myconnstring = "data source=oracle8i;integrated security=yes"; oracleconnection myconnection = new oracleconnection(myconnstring); myconnection.open(); messagebox.show("serverversion: " + myconnection.serverversion + "/ndatasource: " + myconnection.datasource); myconnection.close();}[c++] public: void createoracleconnection() { string* myconnstring = s"data source=oracle8i;integrated security=yes"; oracleconnection* myconnection = new oracleconnection(myconnstring); myconnection->open(); messagebox::show(string::format( s"serverversion: {0}/ndatasource: {1}", myconnection->serverversion, myconnection->datasource )); myconnection->close();
 }
 

所以說,用.net新提供的managed provider來訪問oracle數據(system.data.oracleclient),
是無法以sys用戶登錄的。
這只有使用oracle odp.net(可以去oracle官方網站下載)

oracle odp.net數據庫訪問連接字符串 

connection string attribute

默認值
描述
connection lifetime
0
maximum life time (in seconds) of the connection
當數據庫連接被返回到連接池中時,它的創建時間將與當前時間比較,如果超過了 connection lifetime 規定的時間,它將被釋放掉。 0 時將被視為最大連接時間。
connection timeout
15
maximum time (in seconds) to wait for a free connection from the pool
data source
empty string
oracle net service name that identifies the database to connect to
dba privilege
empty string
administrative privileges: sysdba or sysoper
decr pool size
1
controls the number of connections that are closed when an excessive amount of established connections are unused
enlist
true
enables or disables serviced components to automatically enlist in distributed transactions
當此值為 true 時,池中現存的所有數據庫連接將被加入到它的創建線程的 transaction context 中。如果不存在這個 transaction context 則無任何變化。
incr pool size
5
controls the number of connections that are established when all the connections in the pool are used
max pool size
100
maximum number of connections in a  pool
min pool size
1
minimum number of connections in a pool
password
empty string
password for the user specified by user id
persist security info
false
enables or disables the retrieval of password in the connection string
pooling
true
enables or disables connection pooling
proxy user id
empty string
user name of the proxy user
proxy password
empty string
password of the proxy user
user id
empty string
oracle user name
 
 
 
// c#
...
oracleconnection con = new oracleconnection();
con.connectionstring = "user id=scott;password=tiger;data source=oracle;
pooling=true;enlist=true;min pool size=10;connection lifetime=120;
connection timeout=60;incr pool size=5; decr pool size=2";
con.open();
...
 
以下網站提供連接字符串大全:
www.connectionstrings.com
 
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 易门县| 家居| 天峨县| 海口市| 东方市| 德庆县| 张掖市| 加查县| 浦东新区| 桐城市| 盐亭县| 新源县| 正定县| 驻马店市| 桐柏县| 顺昌县| 常山县| 南汇区| 乌拉特后旗| 高陵县| 潼南县| 明溪县| 石棉县| 台湾省| 临湘市| 青冈县| 南岸区| 宝坻区| 蒙城县| 罗定市| 柳江县| 启东市| 三明市| 四平市| 丹棱县| 大丰市| 诏安县| 万盛区| 益阳市| 明星| 娱乐|