Free programming IDEs are a great benefit for everybody who's interested in Programming and for little but ambitious companies. One of these free IDEs is the Lazarus IDE. It's a "clone" of the Delphi IDE by Embarcadero (originally by Borland). But actually Lazarus is much more than a clone: Using the Free Pascal-Compiler, it was platform-independent and cross-compiling since it was started.
I am using Lazarus very often - especially for building GUIs easily because Java is still Stone-Age when a GUI is required (though there is a couple of GUI-building tools - they all are much less performant than Delphi / Lazarus).
In defiance of all benefits of Lazarus there still is one Problem. Not all Components are designed for use on a 64 bit systems. Considering that 64 bit CPUs are common in ordinary PCs since at least 2008, this is very anpleasant.
One of the components which will not be available on 64 bit installations is the TOracleConnection of Lazarus' SQLDB package. But even if you can use it, there is one big problem: Like in all freeware (and lots of commercial products) , the documentation is very poor and inconsistent. More precisely it is almost useless if you don't have a local Oracle server running on your system. So who does? I do not and finding out how to use the settings of TOracleConnection for connecting to another Oracle DB server was a tricky issue. "So why don't you use Google?" you may be thinking now. The answer will surprise you: Because there is no working answer for remote DB servers (such that are not running locally on your system / in your network segment).
At first you need a working installation of Oracle's Instant Client to be sure that a connection to the DB instance is possible. This will require a file called "tnsadmin.ora". In this file the connection identifiers are stored. You will need some content of this file. Assume that the file contains the following content (new lines have been removed):
So how are the properties of the TOracleConnection to be set? The correct settings for using the connections are pictured below. Important is, that the property "Database" has to contain the full service name and not the user scheme. Further the "HostName" property has to be followed by the port number. These two tiny idiosyncrasies are not written in no tutorial and no example.
I don't know how the english Lazarus Forums will help you but the German one always respond something like "(...) use the Zeos database components(...).
Well... it's an answer but sure this answer is not satisfying. Using another free component means using a 3rd party component. And this will mean that your project will be dependent of the motivation of other external people. An this can become a huge problem. I already made those sad experience.
I am using Lazarus very often - especially for building GUIs easily because Java is still Stone-Age when a GUI is required (though there is a couple of GUI-building tools - they all are much less performant than Delphi / Lazarus).
In defiance of all benefits of Lazarus there still is one Problem. Not all Components are designed for use on a 64 bit systems. Considering that 64 bit CPUs are common in ordinary PCs since at least 2008, this is very anpleasant.
One of the components which will not be available on 64 bit installations is the TOracleConnection of Lazarus' SQLDB package. But even if you can use it, there is one big problem: Like in all freeware (and lots of commercial products) , the documentation is very poor and inconsistent. More precisely it is almost useless if you don't have a local Oracle server running on your system. So who does? I do not and finding out how to use the settings of TOracleConnection for connecting to another Oracle DB server was a tricky issue. "So why don't you use Google?" you may be thinking now. The answer will surprise you: Because there is no working answer for remote DB servers (such that are not running locally on your system / in your network segment).
The Solution
After that introduction I will show the required settings immediately, therefore exemplify the premises.At first you need a working installation of Oracle's Instant Client to be sure that a connection to the DB instance is possible. This will require a file called "tnsadmin.ora". In this file the connection identifiers are stored. You will need some content of this file. Assume that the file contains the following content (new lines have been removed):
DJANGO =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = django.myhost.org)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = DEBIAN.myhost.org)
)
)
So how are the properties of the TOracleConnection to be set? The correct settings for using the connections are pictured below. Important is, that the property "Database" has to contain the full service name and not the user scheme. Further the "HostName" property has to be followed by the port number. These two tiny idiosyncrasies are not written in no tutorial and no example.
Properties of TOracleConnection |
Well... it's an answer but sure this answer is not satisfying. Using another free component means using a 3rd party component. And this will mean that your project will be dependent of the motivation of other external people. An this can become a huge problem. I already made those sad experience.
Kommentare
Kommentar veröffentlichen