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.