UniDAC 访问Oracle数据库(使用 Direct 模式) 远程 UniConnection

当你选择Oracle作数据库服务器时,客户端一般需要装一个 客户端,而且还要做连接配置,尤其是C/S模式,客户端多的时候非常不便。当然,网上也有一个10M左右的Oracle精简客户端,性能和稳定性和官方版差不多。

Oracle还提供了Direct Mode(直连模式),只要你的客户端机子支持TCP/IP协议,完全可以不用安装Oracle客户端及其连接配置。幸运的是,UniDAC也提供了Direct Mode。只需要如下简单配置:

1、在TUniConnection控件上点击右键,选择菜单“Connection Editor”,在弹出的对话框中选择分页“Options”,“Options for Provider”选择“Oracle”,然后在其详细的配置表中,将Direct设置为True。

2、TUniConnection的属性和一般连接oracle差不多,只是将其Server属性改为:

TUniConnection.Server :='IP:Port:SID';

如:

TUniConnection.Server :='192.168.1.1:1521:orcl;

具体举例:

uniconnection1.server:='192.168.1.1:1521:orcl';

uniconnection1.username:='username';

uniconnection1.password:='password';

而且,因为 uniquery 有 FetchRows 属性,可以设定一次获取记录的行数。

此属性同 ODAC 的组件属性,其实我们一般打开数据一次不需要太多,太多也是一批一批查阅,

所以这个属性非常人性化,另外,对比了一下 uniDAC Dricet模式和 ADO db OLE读 ORACLE的效率,发觉即使将 FetchRows 设置为最大,其效力也高于 ADO 通过 ODBC封装对ORACLE数据库的读取效率, Provider=OraOLEDB.Oracle.1;Password=***;Persist Security Info=True;User ID=***;Data Source=**** 。

另外,uniDAC获取SQL server的效率也高于 ADO for sql DB OLE ;

但是有一点是uni 低于ado的,那就是对 ACCESS 的访问,试过多次,访问 单机桌面数据库,uni 低于Ado。

以上是本人草率的体验,不当之处请包涵: ; QQ 965578819 。

*********************************************************************************

另外,发现uniquery 和 unitable 的 SpecificOptions 属性,需要设置 FetchAll=False

才能使 FetchRows 的设置生效,而默认情况下, oracle 是设置

Oracle.FetchAll=False;

而对去 sql server 和 mysql 等,却是设置的 XXX.FetchAll=True 。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Universal Data Access Components (UniDAC) is a powerful library of nonvisual cross-database data access components for Delphi, Delphi for .NET, C++Builder, and Free Pascal. The UniDAC library is designed to help programmers develop faster and cleaner cross-database applications. UniDAC is a complete replacement for standard database connectivity solutions and presents an efficient native alternative to the Borland Database Engine and dbExpress for access to Oracle, SQL Server, MySQL, InterBase, Firebird, SQLite, DB2, Microsoft Access, Advantage Database Server, Adaptive Server Enterprise, and other databases (using ODBC provider). UniDAC is based on the well-known Data Access Components from Devart such as ODAC, SDAC, MyDAC, IBDAC, and PgDAC. We have joined the experience of long-term successful development into one great product which provides unified access to popular databases such as Oracle, Microsoft SQL Server, MySQL, InterBase, Firebird, SQLite, DB2, Microsoft Access, Advantage Database Server, Adaptive Server Enterprise, and other databases (using ODBC provider). The UniDAC library is actively developed and supported by Devart Team. If you have questions about UniDAC, email the developers at unidac@devart.com or visit UniDAC online at http://www.devart.com/unidac/. Advantages of UniDAC Technology UniDAC is very convenient in setup and usage. It provides transparent server-independent interface for working with different databases. Selected database provider ensures the best way to perform operations on the server. Universal Data Access UniDAC provides transparent server-independent interfaces for working with different databases, and lets you change the client engine for specific server type just by changing single connection option. It means that you can easily switch between database servers in your cross-database UniDAC-based application. Server-Aware Providers UniDAC chooses the best way specific to the server to perform most operations. Every UniDAC data provider uses server-specific native connectivity. All operations with data are performed by providers automatically considering peculiarities of the selected database server. Optimized Code The goal of UniDAC is to enable developers to write efficient and flexible database applications. The UniDAC library is implemented using advanced data access algorithms and optimization techniques. Classes and components undergo comprehensive performance tests and are designed to help you write high-performance, lightweight data access layers. Compatibility with Other Connectivity Methods The UniDAC interface retains compatibility with standard VCL data access components like BDE. Existing BDE-based applications can be easily migrated to UniDAC and enhanced to take advantage of server-specific features. Development and Support UniDAC is a cross-database connectivity solution that has been actively developed and supported. UniDAC comes with full documentation, demo projects, and fast (usually within one business day) technical support by the UniDAC development team. Find out more about how to get help or submit feedback and suggestions to the UniDAC development team in the Getting Support topic. A description of the UniDAC components is provided in the Component List.

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值