ODAC application Techniques (i) using the ODAC net approach

Source: Internet
Author: User
Tags port number oracle database

Most applications connect to Oracle database servers using the OCI ODAC standard approach. This is the most common way to design Oracle applications using a Third-party development language. All the OCI interfaces are used as internal libraries, making it very small to compile the generated applications. However, this requires the installation of Oracle client software on the client computer, which costs additional overhead for installation and management. Sometimes, it is even impossible to install an Oracle client program. For example, if you need to set up your application on a remote computer, you cannot provide special file support.

ODAC Net allows your application to connect to Oracle directly via the TCP/IP protocol, without the need for Oracle client software. To run an application that uses ODAC Net, you need only one operating system that supports the TCP/IP protocol.

To connect to an Oracle server using ODAC Net, you need to know the address of the Oracle server, the listener port number, and the database instance name.

Before you use the net option in your application, you only need to set the Torasession object's option net to True and specify its server property as the specified database. If you use the ODAC standard way to connect to the database through OCI, you must set the Server property to TNS alias, but now using the ODAC Net option, you only need to specify the database string, in the following format: Host:Port:SID.

Here, the Host refers to the server address, port means the server listens for the port number, and the SID refers to the specific system Instance name.

Here's an example of connecting to a database without using OCI:

Var

Session:torasession;

. . .

Session.Options.Net: = True;

Session.username: = ' Scott ';

Session.password: = ' Tiger ';

Session.server: = ' 205.227.44.44:1521:ORCL ';

Session.connect;

Note: These are necessary for your application to support the Net option. You don't need to rewrite other parts of the application. In addition, you can connect Oracle at any time via OCI. To implement it, you only need to set the TOraSession.Options.Net option to False.

OCI and Net:

Applications compiled using the ODAC standard and Net approach are very similar in size and speed to the program. The use of the Net option is not the same as encryption for Oracle using OCI, in terms of security. Net uses DES to authenticate security, and now it does not support Oracle encryption.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.