01.pengantar dan kontrak kuliah

18
Pemrograman Basis Data Tri Afirianto, S.T., M.T. tri.afirianto@u b.ac.id Universitas Pengantar dan Kontrak Kuliah

Upload: killerhellmy-dewa-emilian

Post on 11-Jul-2016

22 views

Category:

Documents


3 download

DESCRIPTION

jgij

TRANSCRIPT

Page 1: 01.Pengantar Dan Kontrak Kuliah

Pemrograman Basis Data

Tri Afirianto, S.T., [email protected] Brawijaya

Pengantar dan Kontrak Kuliah

Page 2: 01.Pengantar Dan Kontrak Kuliah

Peraturan Kuliah• Berdasarkan Buku Pedoman PTIIK

Page 3: 01.Pengantar Dan Kontrak Kuliah

Materi Kuliah• Stored Procedure Introduction• Basic SQL Procedure Structure• Overview SQL• Using Flow of Control Statements• Cursor and Result Sets• Condition Handling• Dynamic SQL• Nested Stored Procedure• User Defined Functions (UDFs)• Trigger

Page 4: 01.Pengantar Dan Kontrak Kuliah

Perkuliahan• Penilaian:• Quis : 20%• UTS : 15%• UAS/Project : 20%• Ujian Koding : 20%• Praktikum : 25%

Page 5: 01.Pengantar Dan Kontrak Kuliah

Aturan Kelas• Kuliah hadir tepat waktu (batas keterlambatan 15

menit)• Kehadiran minimal 80%• Jujur dan bersungguh-sungguh dalam mengerjakan

setiap tugas• Menghindari plagiasi dalam setiap tugas• Pelanggaran plagiasi akan memperoleh sanksi:

pekerjaan tidak diakui (nilai 0)

Page 6: 01.Pengantar Dan Kontrak Kuliah

Etika Mengirim Pesan

Page 7: 01.Pengantar Dan Kontrak Kuliah

Filosofi Pemrograman

“Everybody should learn how to program a computer …because it teaches you how to think.”

- Steve Jobs -

Page 8: 01.Pengantar Dan Kontrak Kuliah

Filosofi Pemrograman

“Good programmer write code for machine…..”

Page 9: 01.Pengantar Dan Kontrak Kuliah

Filosofi Pemrograman

“Great Programmer write code for other programmer…..”

Page 10: 01.Pengantar Dan Kontrak Kuliah

DB2 Stored Procedure Introduction

Page 11: 01.Pengantar Dan Kontrak Kuliah

Unit Objectives• After completing this unit, you should be able to:• Describe a stored procedure• Determine when a stored procedure should be used• Describe execution flow using stored procedures• List DB2 stored procedure design and general tips

Page 12: 01.Pengantar Dan Kontrak Kuliah

What is a Stored Procedure?A Stored Procedure:• Is an executable program under control of the DB2

server• Is invoked via the SQL CALL statement• May contain business logic• May be invoked locally or remotely• May receive or pass parameters• May produce result sets

Page 13: 01.Pengantar Dan Kontrak Kuliah

When to Use a Stored Procedure

Stored Procedure may be justified when:• The application’s performance expectations are not

being met• There are a large number of clients to which

application code is distributed• The client application generates relatively heavy

database activity, but involves little user interaction• The client application code changes frequently• The access to the client application code needs to

be controlled• The client application executes many SQL

statements

Page 14: 01.Pengantar Dan Kontrak Kuliah

Considerations when Using Stored Procedures

Stored Procedures are incorporated by:• Determining client portion of application• Thin client?• Selecting stored procedure server• Developing stored procedure• Determining calling parameters• Selecting programming language SQL PL / PL SQL,

IBM DB2 Data Studio Developer / CLP, Command Editor, Text Editor• Defining SP to server• Coding and testing

Page 15: 01.Pengantar Dan Kontrak Kuliah

Application Flow

Page 16: 01.Pengantar Dan Kontrak Kuliah

Client/Server: the Big Picture

Page 17: 01.Pengantar Dan Kontrak Kuliah

Server Procedure: Design/General Tips• Consider the cost of invoking a stored procedure

versus the cost of network transmission for a distributed application• Stored procedures run in background – do not use

the standard I/O streams• No commands to terminate current process• Overloading stored procedures restricted to

parameter subsets• SQL limited by stored procedure CREATE

parameters

Page 18: 01.Pengantar Dan Kontrak Kuliah

Unit Summary• Describe a stored procedure• Determine when a stored procedure should be

used• Describe execution flow using stored procedures• List DB2 stored procedure design and general tips