Author: h.mohri
At this point, Instant Client configuration is complete.
Finally, “./PAServer-19.0/paserver” is started up and ready.
[Create a new project.]
In Delphi IDE side, create a new project. Web Server Application, check Linux.
I chose “stand-alone console application” this time.
Place some components on TWebModule1.
TFDConnection, TFDPhysOracleDriverLink, TFDQuery, TFDStanStorageJSONLink
Return the contents acquired by FDQuery1 with JSON. Write the code.
There is a simple table and some records on DB side.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
//// procedure TWebModule1.WebModule1DefaultHandlerAction(Sender: TObject; Request: TWebRequest; Response: TWebResponse; var Handled: Boolean); var ms_: TMemoryStream; begin FDQuery1.Active := True; ms_ := TMemoryStream.Create; FDQuery1.SaveToStream(ms_, TFDStorageFormat.sfJSON); ms_.Position := 0; Response.ContentStream := ms_; end; procedure TWebModule1.WebModuleCreate(Sender: TObject); begin FDPhysOracleDriverLink1.VendorLib := '/opt/oracle/instantclient_12_2/libclntsh.so'; FDConnection1.Connected := True; end; |
When executing debugging, the following option is mandatory.
“/usr/bin/xterm -e “%debuggee%””
[In case of failure.]
1 2 |
//// Project raised exception class EFDException with message '[FireDAC][Phys][Ora]-314. Cannot load vendor library [libclntsh.so]. Hint: check it is in the PATH or application EXE directories, and has x64 bitness.'. |
Failure Review the environment on the Linux side.
[In case of success.]
The content saved by JSON of FDQuery1 is displayed.
Do you want to try Embarcadero’s Cross-Platform Development Framework? InterBase is an ultrafast, scalable, embeddable SQL database with commercial grade data security, disaster recovery, and change synchronization. Request a free full trial here.
Design. Code. Compile. Deploy.
Start Free Trial Upgrade Today
Free Delphi Community Edition Free C++Builder Community Edition