Delphi XE2 with Zeoslib and Oracle Connection

1.5k views Asked by At

Can anyone help me in setting up ZeosLib 7.1.4a to connect to Oracle 11g Release 2 Standard database.

Currently we are using Delphi XE2, oracle is installed and the tnsnames.ora file specifies the connections to our different servers and databases, and it is also set up within BDE.

We need to move away from BDE components as they are no longer available with Delphi XE3 and upwards. We use Direct Oracle Access components, but that is a paid 3rd party software, that is why we want to move over to ZeosLib.

What settings need to be set on the ZConnection component in order for it to connect to the oracle database, as there is a Database parameter and LibraryLocation parameter that are looking for actual files, and then there is the HostName parameter?

1

There are 1 answers

0
GabrielF On

I never used Oracle, but I don't think it should be too different from Firebird, MySQL, SQL Server and others I've tried on Zeos.

The properties you need to set are:

  • Protocol = oracle;
  • HostName = your database server ip is probably your best bet; maybe you don't need this for oracle due to tnsnames... try leaving it empty
  • Database = your database name. This could be a filename (in the server) or a database alias;
  • User = User name to connect to the database;
  • Password = well, the password...

LibraryLocation is the location of the client-side library (a dll) to use for the connection. Normally you don't need to set this property if your library is installed to your system folder or comes along with your executable.

You may also need to set the Port if it's not the default one.