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. * * * ************************************************************* ENVIRONMENTDIVISION. CONFIGURATIONSECTION. SOURCE-COMPUTER. xyz. OBJECT-COMPUTER. xyz.
DATADIVISION. WORKING-STORAGESECTION.
* Embedded SQL COBOL (file "AUTHID.PCO")
EXECSQL BEGIN DECLARE SECTIONEND-EXEC.
01 uid picture x(18).
01 pwd picture x(18). EXECSQLEND DECLARE SECTIONEND-EXEC. EXECSQL INCLUDE sqlca END-EXEC.
LINKAGESECTION.
01 uid2 picture x(18).
PROCEDUREDIVISIONUSING 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 EXECSQL CONNECT :uid IDENTIFIED BY :pwd END-EXEC.
if SQLCODE = 0 display"AUTHID:INFO: logon for user: " uid elsedisplay"AUTHID:FATAL: logon failed: " uid. EXITPROGRAM.
¤ Dauer der Verarbeitung: 0.13 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.