oracle 连接字符串格式,连接字符串格式和属性

连接字符串格式和属性Connection String Format and Attributes

01/19/2017

本文内容

重要

此功能将在 Windows 的将来版本中删除。This feature will be removed in a future version of Windows. 请避免在新的开发工作中使用该功能,并着手修改当前还在使用该功能的应用程序。Avoid using this feature in new development work, and plan to modify applications that currently use this feature. 请改用 Oracle 提供的 ODBC 驱动程序。Instead, use the ODBC driver provided by Oracle.

某些应用程序可能需要指定数据源连接信息的连接字符串,而不是使用对话框。Instead of using a dialog box, some applications might require a connection string that specifies data source connection information. 连接字符串由多个属性组成,它们指定了驱动程序连接到数据源的方式。The connection string is made up of a number of attributes that specify how a driver connects to a data source. 属性标识了驱动程序在可以进行适当的数据源连接之前需要了解的特定信息。An attribute identifies a specific piece of information that the driver needs to know before it can make the appropriate data source connection. 每个驱动程序可能有一组不同的属性,但连接字符串格式始终相同。Each driver might have a different set of attributes, but the connection string format is always the same. 连接字符串具有以下格式:A connection string has the following format:

"DSN=data-source-name[;SERVER=value] [;PWD=value] [;UID=value] [;=]"

备注

Microsoft ODBC Driver for Oracle 支持使用 CONNECTSTRING = 而不是的第一个版本的驱动程序的连接字符串格式 SERVER= 。The Microsoft ODBC Driver for Oracle supports the connection string format of the first version of the driver, which used CONNECTSTRING= instead of SERVER=.

如果要连接到支持 Windows 身份验证的数据源提供程序,应 Trusted_Connection=yes 在连接字符串中指定而不是用户 ID 和密码信息。If you are connecting to a data source provider that supports Windows authentication, you should specify Trusted_Connection=yes instead of user ID and password information in the connection string.

如果未指定 UID、PWD、SERVER (或 CONNECTSTRING) 和驱动程序属性,则必须指定数据源名称。You must specify the data source name if you do not specify the UID, PWD, SERVER (or CONNECTSTRING), and DRIVER attributes. 但是,所有其他属性都是可选的。However, all other attributes are optional. 如果未指定属性,则该属性默认为在 " ODBC 数据源管理器 " 对话框的 "相关 DSN" 选项卡中指定的属性。If you do not specify an attribute, that attribute defaults to the one specified in the relevant DSN tab of the ODBC Data Source Administrator dialog box. 属性值可能区分大小写。The attribute value might be case-sensitive.

连接字符串的属性如下所示:The attributes for the connection string are as follows:

AttributeAttribute

描述Description

默认值Default value

DSNDSN

" ODBC 数据源管理器 " 对话框的 "驱动程序" 选项卡中列出的数据源名称。The data source name listed in the Drivers tab of the ODBC Data Source Administrator dialog box.

""""

PWDPWD

要访问的 Oracle 服务器的密码。The password for the Oracle Server that you want to access. 此驱动程序支持 Oracle 置于密码中的限制。This driver supports limitations that Oracle places on passwords.

""""

SERVERSERVER

要访问的 Oracle 服务器的连接字符串。The connect string for the Oracle Server that you want to access.

""""

UIDUID

Oracle 服务器用户名。The Oracle Server user name. 此属性可能不是可选的,具体取决于您的系统,此属性可能会出于安全目的而需要此属性。Depending on your system, this attribute might not be optional - that is, certain databases and tables might require this attribute for security purposes.

使用 "/" 来使用 Oracle 的操作系统身份验证。Use "/" to use Oracle's operating system authentication.

""""

BUFFERSIZEBUFFERSIZE

提取列时使用的最佳缓冲区大小。The optimal buffer size used when fetching columns.

驱动程序会优化提取,以便从 Oracle 服务器提取一次,以填充此大小的缓冲区。The driver optimizes fetching so that one fetch from the Oracle Server returns enough rows to fill a buffer of this size. 如果提取大量数据,更大的值通常会提高性能。Larger values tend to increase performance if you fetch a lot of data.

6553565535

SYNONYMCOLUMNSSYNONYMCOLUMNS

如果此值为 true (1) ,则 ) API 调用的 SQLColumn ( 返回列信息。When this value is true (1), an SQLColumn( ) API call returns column information. 否则,SQLColumn ( ) 只为表和视图返回列。Otherwise, SQLColumn( ) returns only columns for tables and views. 如果未设置此值,则用于 Oracle 的 ODBC 驱动程序可提供更快的访问。The ODBC Driver for Oracle provides faster access when this value is not set.

11

REMARKSREMARKS

如果此值为 true (1) ,则驱动程序将返回 SQLColumns 结果集的备注列。When this value is true (1), the driver returns Remarks columns for the SQLColumns result set. 如果未设置此值,则用于 Oracle 的 ODBC 驱动程序可提供更快的访问。The ODBC Driver for Oracle provides faster access when this value is not set.

00

StdDayOfWeekStdDayOfWeek

强制执行 DAYOFWEEK 标量的 ODBC 标准。Enforces the ODBC standard for the DAYOFWEEK scalar. 默认情况下,此功能处于打开状态,但需要本地化版本的用户可以将行为更改为使用 Oracle 返回的任何内容。By default this is turned on, but users who need the localized version can change the behavior to use whatever Oracle returns.

11

GuessTheColDefGuessTheColDef

指定驱动程序是否应为SQLDescribeCol的cbColDef参数返回非零值。Specifies whether or not the driver should return a non-zero value for the cbColDef argument of SQLDescribeCol. 仅适用于没有 Oracle 定义的刻度的列,例如,计算所得的数值列和定义为数值的列,无精度或小数位数。Applies only to columns where there is no Oracle-defined scale, such as computed numeric columns and columns defined as NUMBER without a precision or scale. 当 Oracle 不提供该信息时, SQLDescribeCol 调用返回130的精度。A SQLDescribeCol call returns 130 for the precision when Oracle does not provide that information.

00

例如,使用 MyOracleServerOracle 服务器和 Oracle 用户 MyUserID 连接到 MyDataSource 数据源的连接字符串应为:For example, a connection string that connects to the MyDataSource data source using the MyOracleServerOracle Server and the Oracle User MyUserID would be:

"DSN={MyDataSource};UID={MyUserID};PWD={MyPassword};SERVER={MyOracleServer}"

使用操作系统身份验证和 MyOtherOracleServerOracle 服务器连接到 MyOtherDataSource 数据源的连接字符串应为:A connection string that connects to the MyOtherDataSource data source using operating system authentication and the MyOtherOracleServerOracle Server would be:

"DSN=MyOtherDataSource;UID=/;PWD=;SERVER=MyOtherOracleServer"

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值