slide1 n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
When is the highest pollution? PowerPoint Presentation
Download Presentation
When is the highest pollution?

Loading in 2 Seconds...

play fullscreen
1 / 6

When is the highest pollution? - PowerPoint PPT Presentation


  • 133 Views
  • Uploaded on

When is the highest pollution?. Thick Client : Business logic resides at client. Select * From My_Demo_Test ;. Return table data (cursor). DB Server Oracle. Data is processed at client side. Client (Java, JDBC). Int maxPos() { … } Int main() { … EXEC SQL BEGIN DECLARE SECTION;

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'When is the highest pollution?' - paley


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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
slide2

Thick Client : Business logic resides at client

Select * From My_Demo_Test ;

Return table data (cursor)

DB Server Oracle

Data is processed at client side

Client (Java, JDBC)

slide3

Int maxPos() {

}

Int main() {

EXEC SQL BEGIN DECLARE SECTION;

char szServerDatabase[(SQLID_MAX * 2)+2] = “dbname";

char szLoginPassword[(SQLID_MAX * 2)+2] = “uname.password";

int t0, t1, t2, t3, t4 ;

EXEC SQL END DECLARE SECTION;

EXEC SQL CONNECT TO:szServerDatabaseUSER:szLoginPassword;

EXEC SQL DECLAREC1CURSOR FORSELECT * FROM my_demo_test;

EXEC SQL OPENC1 ;

EXEC SQL FETCH C1 INTO :t0, :t1, :t2, :t3, :t4 ;

while (SQLCODE == 0) {

Pos = maxPos(t0, t1, t2, t3, t4);

PosCount[Pos] = PosCount[Pos] + 1;

EXEC SQL FETCH C1 INTO :t0, :t1, :t2, :t3, :t4 ;

}

<-- Print out results -->

}

slide4

Executing sp…

Thin Client : Business logic resides at server

Package isk_demo {

MaxPos() ;

PosCount() ;

}

Package isk_demo {

MaxPos() ;

PosCount() ;

}

Call isk_demo.PosCount() ;

Results

DB Server Oracle

Client (Sql*plus)

slide5

Create Or Replace Package isk_demo As

FunctionMaxPos(t1 Float, t2 Float, t3 Float, t4 Float, t5 Float) Return Integer ;

ProcedurePosCount ;

End isk_demo ;

Create Or Replace Package Body isk_demo As

<-- Body of package goes here -->

End isk_demo ;

slide6

Create Or Replace Package Body isk_demo As

FunctionMaxPos(…) Return Integer

<-- Body of function goes here -->

End MaxPos ;

ProcedurePosCount

As Cursor rSet Is

Select * From My_Demo_Test ;

Begin

For rSetRow In rSet Loop

I := MaxPos(rSetRow.t0, rSetRow.t1, rSetRow.t2, rSetRow.t3, rSetRow.t4) ;

PosCountArray(I) := PosCountArray(I) + 1 ;

End Loop ;

<-- Return the result -->

End PosCount ;

End isk_demo ;