Examples of Devart UniDac connecting to Oracle database

Examples of Devart Unidac connecting to an Oracle database using Oracle Client and direct connection (no Oracle Client)

Unidac can connect to an Oracle database in a few different ways.  Ill show the property settings to connect to some of these, using direct and client connection, and with / without Oracle client entries.

This presumes that you know the basics of the configuring the Oracle Client, so I wont explain how to configure the tnsnames.ora file.

For these examples
– the database server name is HRPROD
– the database name is HR
– the client port is 1521.  This is the default and it can be different
– user name is FRED
– password is BEDROCK

The name of the entry in the tnsnames.ora or LDAP is HRPRODXXX

You can use the server ip instead of the server name

Add these components to your form or data module

  • OracleUniProvider
  • UniConnection

Change the UniConnection properties as noted below

Oracle Client with a tnsnames.ora or LDAP entry

UniConnection1.ProviderName := ‘Oracle’;
UniConnection1.UserName := ‘FRED’;
UniConnection1.Password := ‘BEDROCK’;

UniConnection1.SpecificOptions.Values[‘Direct’] := ‘False’;

UniConnection1.server := ‘HRPRODXXX’;   // tnsname or ldap entry name
UniConnection1.database = ”;
UniConnection1.port = 0;

Oracle Client without a tnsnames.ora or LDAP entry

UniConnection1.ProviderName := ‘Oracle’;
UniConnection1.UserName := ‘FRED’;
UniConnection1.Password := ‘BEDROCK’;

UniConnection1.SpecificOptions.Values[‘Direct’] := ‘False’;

UniConnection1.server := ‘HRPROD’;  // server name or IP address
UniConnection1.database = ‘HR’;     //  if using a service instead of sid use ‘sn=HR’
UniConnection1.port = 1521;

 

Direct connect to Oracle database (no Oracle Client)

UniConnection1.ProviderName := ‘Oracle’;
UniConnection1.UserName := ‘FRED’;
UniConnection1.Password := ‘BEDROCK’;

UniConnection1.SpecificOptions.Values[‘Direct’] := ‘True’;
UniConnection1.server := ‘HRPROD:1521:HR’;   // for service use ‘HRPROD:1521:sn=HR’
UniConnection1.database = ”;
UniConnection1.port = 1521;

 

About Me

scott_hollows_201611

  • Oracle & Delphi software developer based in Perth, Western Australia
  • Australian Delphi User Group – President and WA meeting organizer
  • Australian Oracle User Group – WA State Committee Member
  • Available to do remote presentations to user groups on Delphi and Oracle topics
blog email linkedinlogo

 

 

Author: Scott Hollows

Enterprise software developer based in Perth, Western Australia. Focused on Oracle, Delphi, Data Warehouse design and ETL, Data Architect, Business Intelligence, Oracle performance tuning. President of the Australian Delphi User Group (ADUG) LinkedIn www.linkedin.com/in/scotthollows

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s