1 / 8

Agenda

Agenda. 一. Three Tier 程式寫法介紹 二. DLL 寫法介紹 三. Toad 基本操作介紹 四. ODAC 安裝與使用介紹. 一. Three Tier 程式寫法介紹  Page1. (一).創建應用服務器的步驟 1. 創建應用程序 2. 創建遠程數據模板 3. 在數據模塊上放置數據集組件 4. 在遠程數據模板上放置 TDataSetProvider 組件 5. 設置 TDataSetProvider 組件的 DataSet 屬性

lyris
Download Presentation

Agenda

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Agenda 一.Three Tier 程式寫法介紹 二.DLL寫法介紹 三.Toad 基本操作介紹 四.ODAC 安裝與使用介紹

  2. 一.Three Tier 程式寫法介紹Page1 (一).創建應用服務器的步驟 1.創建應用程序 2.創建遠程數據模板 3.在數據模塊上放置數據集組件 4.在遠程數據模板上放置TDataSetProvider組件 5.設置TDataSetProvider組件的DataSet屬性 注意:TDataSetProvider的poAllowCommandText屬性一定要設成true,否則,在Client端給ClientDataSet的CommandText屬性賦值的時候會出現Error:"Command Text change are not allowed" 6.編寫應用服務器的代碼. 7.保存.編譯和註冊或安裝應用服務器 如果使用的是Dcom,http or sockets通信協議,應用服務器就是一個自動服務器,必須像Com服務器一樣進行註冊. 8.安裝有關運行期軟體 對於Tcp/IP連接方式來說,需要安裝Scktsrvr.exe(新建一個port,以便在Client端Socketconnection的port 屬性設置.)

  3. Application Server 1 SFC Client Database Server SFC Client Application Server 2 一.Three Tier 程式寫法介紹Page2 Application Server

  4. 一.Three Tier 程式寫法介紹Page3 (二).創建Client 端程序的步驟: 1.放置SocketConnection組件 a.先設置其屬性Host,輸入Ap server所在電腦的IP Address; b.後設置Port為上述新增之port號 c.設置其ServerName為上述新建之Ap server Name.Remote DataModule中類; d.Connected設為true; 2.放置ClientDataSet組件 只需要設定其屬性RemoteServer為上述SocketConnetion即可.其CommandText屬性類似與Sql屬性

  5. 一.Three Tier 程式寫法介紹Page4 (三).安裝Borland scktsrvr 服務和註冊midas.dll 1>.windows-->開始-->執行中輸入:path\scktsrvr -install即可安裝此服務 2>.把midas.dll copy至windows/system32\ a.windows-->開始-->執行中輸入:regsvr32 midas 即可註冊midas 服務. b.copy midas文件,然後選中regsvr32.exe,單擊右鍵,粘貼即可註冊 .\Scktsrvr.exe負責與client溝通的服務 .\Midas.dll 負責與AP Server溝通

  6. 二.DLL寫法介紹Page1 (一).靜態調用DLL示例: procedure SynAPP(App:THandle);stdcall;external 'BOM.dll'; procedure ShowForm;stdcall;external 'BOM.dll'; (二).動態調用DLL示例: Var handle:THandle; FPointer:TFarProc; myproc:TShowForm; Try handle:=LoadLibrary('BOM.dll'); if handle<>0 then try FPointer:=GetProcAddress(handle,'ShowForm'); if FPointer<>nil then Begin myproc:=TShowForm(FPointer); myproc; End; Finally FreeLibrary(handle); End; Except showmessage('loading dll err'); End;

  7. 二.DLL寫法介紹Page2 Dll的兩種調用方式在Delphi中的比較 靜態方法實現簡單,運行速度也稍微快一點,也更加安全可靠一些;所需代碼較少;但在運行時不能靈活的裝卸所需的dll;而是在主程序運行時就加載直到程序結束才釋放該dll;並且如要加載的dll不存在或者dll中沒有要引入的過程或函數,這時候程序就自動停止運行; 動態方法較好的解決了靜態方法中的不足,在需要用到的時候才通過LoadLibrary函數引入;用完後通過FreeLibrary函數從內存中卸載;而且通過調用GetProcAddress函數可以指定不同的函數或過程;更重要的是,如果指定的dll出錯,至多是API調用失敗,不會導致程序終止.

  8. 三.Toad 基本操作介紹 1.建立各中Objects 2.權限(grant & revoke) 2.Data Import & Export 3.利用Toad 對PL/SQL塊進行Debug. 4.DBA: Session Browser &TableSapce &DB Monitor 5.Others

More Related