DB2 Security




CS185c

Chris Pollett

Apr 20, 2010

Outline

Introduction

ODBC Transaction Processing

function calls in ODBC TP

DB2 ODBC Runtime Environment

Quiz

Which of the following statements is true?

  1. If you are using JDBC there is always a prepare phase before a query can be executed
  2. In Embedded C, host variables are declared in a EXEC SQL BEGIN DECLARE SECTION; -- EXEC SQL END DECLARE SECTION; block.
  3. You still need to declare cursors if you are using ODBC.

Java Database Connectivity (JDBC)

Four Types of JDBC Drivers

z/OS DB2 JDBC Driver

JDBC Processing Flow

Example JDBC Application

import java.sql.*;
...
//inside some method
String url = "jdbc:db2:", empNO;

Connection con; Statement stmt; ResultSet rs;

Class.forName("com.ibm.db2.jcc.DB2Driver");

con = DriverManager.getConnection (url);

stmt = con.createStatement();

rs = stmt.executeQuery("SELECT EMPNO FROM EMPLOYEE");

while (rs.next()) {
  empNo = rs.getString(1);	
  System.out.println("Empno=" + empNO); 
}

rs.close(); 
stmt.close(); 
con.close();
...

Dynamic SQL Interactive Tools

Stored Procedure

DB2 Security

Three Main Aspects of Security Connected to DB2

Authentication and Authorization

Authorization ID

Establishing Authorization IDs

CICS Subsystem -- Connection Exit

Example of CICSPRD getting auth ids

CICS User Sign-on Exit

Example of USER01 getting auth ids during signon

Authorization Related Special Registers