Quellcode-Bibliothek
© Kompilation durch diese Firma
[Weder Korrektheit noch Funktionsfähigkeit der Software werden zugesichert.]
Datei:
authid.cob
Sprache: Unknown
IDENTIFICATION DIVISION.
PROGRAM-ID. AUTHID.
*************************************************************
* AUTHID
* This subroutine logs onto the database for userid given.
* Password is assumed to be the same as the userid.
*************************************************************
*************************************************************
* *
**** DISCLAIMER ***** DISCLAIMER ***** DISCLAIMER ***********
* *
* This subroutine is OPTIONAL and is proveded only as an *
* example of how a vendor may accomplish login. This *
* subroutine contains extensions to SQL. This subroutine *
* may be discarded or modified in any way. *
* *
*************************************************************
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. xyz.
OBJECT-COMPUTER. xyz.
DATA DIVISION.
WORKING-STORAGE SECTION.
* Embedded SQL COBOL (file "AUTHID.PCO")
EXEC SQL BEGIN DECLARE SECTION END-EXEC.
01 uid picture x(18).
01 pwd picture x(18).
EXEC SQL END DECLARE SECTION END-EXEC.
EXEC SQL INCLUDE sqlca END-EXEC.
LINKAGE SECTION.
01 uid2 picture x(18).
PROCEDURE DIVISION USING UID2.
P0.
* initialize variables
move uid2 to uid.
* This subroutine supplies all passwords needed.
* For ease in testing, we used password equal to user id.
move uid to pwd.
* log into database
EXEC SQL CONNECT :uid IDENTIFIED BY :pwd END-EXEC.
if SQLCODE = 0
display "AUTHID:INFO: logon for user: " uid
else display "AUTHID:FATAL: logon failed: " uid.
EXIT PROGRAM.
[ Verzeichnis aufwärts0.0unsichere Verbindung
Übersetzung europäischer Sprachen durch Browser
]
|
|