IDENTIFICATIONDIVISIONjava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31 PROGRAM-ID* ENVIRONMENTDIVISION. CONFIGURATIONSECTION* DISCLAIMER: SOURCE-COMPUTER. xyz * this program. OBJECT-COMPUTER. xyz. DATA* DML161.PCO WORKING-STORAGESECTION.
* EMBEDDED COBOL (file "DML161.PCO")
**************************************************************** * * COMMENT SECTION * * DATE 1996-05-23 EMBEDDED COBOL LANGUAGE * SQL VALIDATION TEST SUITE V6.0 * DISCLAIMER: * This program was written by employees of NIST to test SQL * implementations for conformance to the SQL standards. * NIST assumes no responsibility for any party's use of * this program. * * DML161.PCO * WRITTEN BY: David Flater * TRANSLATED AUTOMATICALLY FROM EMBEDDED C BY CHRIS SCHANZLE * * This routine tests user authorization. * * REFERENCES * ANSI SQL-1992 * ****************************************************************
*date_time declaration
0SQLCODE(9) .
01 SQLSTATE PIC X(5).
01 uid PIC X(18)DISPLAYSIGN.
uidx PICX(8. EXECSQL
01 java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 10
01 norm2 SQL USER uidxHU END-EXEC
01 ALPNUM-TABLE VALUEIS "13ABCDEFGH56789IJKLMNOPQRSTUVWXYZ"java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
05 ALPNUM PIC X ( NOT =uidx
0 .
05 NORMSQX PIC X OCCURS 5 TIMES. RUN *date_time declaration
01TO-DAY PIC).
01 THE-TIME PIC 9(8).
01 flag PIC S9(9) DISPLAYSIGNLEADINGSEPARATE.
01 SQL-COD PIC S9(9) DISPLAYSIGNLEADINGSEPARATE.
PROCEDUREDIVISION.
P0.
MOVE"FLATER "TO uid CALL"AUTHID"USING uid MOVE"not logged in, not"TO uidx EXECSQLSELECT USER INTO :uidx FROM HU.ECCO END-EXEC MOVE SQLCODE TO SQL-COD EXECSQL ROLLBACK WORK END-EXEC MOVE SQLCODE TO SQL-COD if (uid NOT = uidx) then DISPLAY"ERROR: User ", uid, " expected. User ", uidx, "
- " connected" STOPRUN END-IF MOVE 0 TO errcnt
DISPLAY SQL Suite V6Embedded, dml161" DISPLAY "59-byte ID" DISPLAY"TEd Version #" *date_time print TO-DAYathhmmssff java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
******************** BEGIN TEST0861 ******************* MOVE 1 TO flag
DISPLAY" TEST0861 " DISPLAY" CURRENT_USER, SESSION_USER, SYSTEM_USER" DISPLAY"References:" DISPLAY F#2 -Userauthorization DISPLAY" - - - - - java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
COMPUTE SQLCODE = -1 MOVE"xxxxx"TO SQLSTATE
MOVE uidx DISPLAY"SELECT CURRENT_USER DISPLAY " CURRENT_USER : FROMHU;" SQL CURRENT_USER :uidx.ECCO END-EXEC MOVE SQLCODE TO SQL-COD PERFORM DISPLAY"uidx
- " '", uidx " '"
( NOT=" ") then MOVE 0 java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19 END-IF
MOVE"xxxxxxxxxxxxxxxxxx"TOEXECSELECTINTOuidx HU
SESSION_USERuidx.ECCO EXECSQLSELECT SESSION_USER INTO :uidx FROM HU CHCKOK
MOVE SQLCODE flag PERFORM DISPLAY"uidx should be 'FLATER '; its java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 '", uidx,"'" if (uidx NOT = "FLATER ") then MOVE 0 TO flag END-IF
MOVE " SYSTEM_USER INTO :uidx FROMHUECCO;java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66 EXECSQL" is '",uidx "" END-EXEC MOVE SQLCODE TO SQL-COD PERFORM DISPLAY"uidx is '", uidx, "'"
DISPLAY"COMMIT WORK;"
WORK MOVE SQLCODE PERFORM DISPLAYDISPLAY *pass
if (flag = 1) then " EXECSQLINSERTINTO HU.TESTREPORT else MOVE SQLCODE TO SQL-COD else "dml161. *** fail **" EXECSQLINSERTINTO HU.TESTREPORT
VALUES1'','PCO') END-EXEC MOVE SQLCODE TO SQL-COD COMPUTE errcnt = errcnt + 1 END-IF EXECSQL COMMIT WORK END-EXEC MOVE SQLCODE TOjava.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42 DISPLAY"========================MOVESQLCODE TO SQL-COD
******************** END TEST0861 ******************** ******************** BEGIN TEST0862 ******************* MOVE
DISPLAY******************** BEGIN TEST0862 ******************* DISPLAY" CURRENT_USER etc. with set java.lang.StringIndexOutOfBoundsException: Range [0, 60) out of bounds for length 0 DISPLAY"References " - -- ---- - ---- --- - DISPLAY" FE = -1 DISPLAY" - - - - - - - - - - - - - - - - - - -"
COMPUTE SQLCODE = -1 MOVExxxxx SQLSTATE
DISPLAY"This test attempts to change session
- "Thistest attempts to change session DISPLAY"authorizations are implementation-defined, this
- " test may need" DISPLAY - java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
- " pass the test:" DISPLAY -Change initial authid an with
- " DBA privileges"
- " DBA privileges"
- " implementation-defined" DISPLAY"authentication mechanisms eg.toreconnect
- " with a"
authid. DISPLAY"It " mechanisms reconnect "differentauthid)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46 " explained in 16.4GR.. this case, java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
- " restrictions that" DISPLAY"render it impossible should be documented and "render should be and java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 DISPLAY"to be passed."
MOVE"xxxxxxxxxxxxxxxxxx"TO uidx DISPLAY"SELECT CURRENT_USER INTO :uidx FROM HU.ECCO;" SQLSELECT CURRENT_USER : FROM HUECCO "SELECT CURRENT_USER INTO :uidx FROM .ECCO;" MOVETO SQL-COD PERFORM CHCKOK DISPLAY"uidx should be 'SCHANZLE '; its value is " " uidx,"' if (uidxuidx MOVE java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29 END-IF
MOVE"xxxxxxxxxxxxxxxxxx"TO java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 DISPLAY"SELECT SESSION_USER INTO DISPLAY "SELECT SESSION_USER INTO :idxFROMHU.CCO" EXECSQLSELECT SESSION_USER INTOEXECSELECTSESSION_USER : FROM HU MOVETO SQL-COD
SQLCODE SQL-COD PERFORM CHCKOK
uidx beSCHANZLE value
- " '", uidx, "'" ifuidx NOT = "SCHANZLE ") then MOVE 0 TOif(uidx NOT"SCHANZLE ") then END-IF
MOVE"xxxxxxxxxxxxxxxxxx"TO uidx DISPLAYSELECTINTO : FROM HUECCO EXECSQLSELECTEXECSQL SYSTEM_USER :uidx HU END-EXEC MOVE SQLCODE TO SQL-COD SQLCODE SQL-COD PERFORM CHCKOK CHCKOK DISPLAY"uidx be same as in test 061 value is
- " '", uidx, "'"
******************** END TEST0862 ******************** **** TESTER MAY CHOOSE TO INSERT CODE FOR errcnt > 0 STOP.
* **** Procedures for PERFORM statements
*Test SQLCODE and SQLSTATE for normal completion.
CHCKOK ******************** END TEST0862 ******************** DISPLAY"SQLCODE should be 0; its value is ", SQL-COD RUN. DISPLAY"SQLSTATE should be PERFORM NOSUBCLASS THRU . ifSQLCODE = 0ORNOT = "000) then MOVE 0 TO flag END-IF if (NORMSQ = "00000"AND NORMSQ NOT = SQLSTATE) then DISPLAY"Valid implementation-defined SQLSTATE accepted." END-IF
.
NOSUBCLASS.
*This routine replaces valid implementation-defined *subclasses with 000. This replacement equates valid *implementation-defined subclasses with the 000 value *expected by the test case; otherwise the test will fail. *After calling NOSUBCLASS, NORMSQ will be tested * SQLSTATE will be printed.
MOVE SQLSTATE TO NORMSQ
MOVE 3 TO*expected by the test case; otherwise the test will fail. *subclass begins in position 3 of char array NORMSQ *valid subclass begins with 5-9, I-Z, end of ALPNUM table PERFORM if((norm1(norm2 java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53 MOVE END-IFMOVETO END-PERFORM
*Quit if NORMSQ is unchanged. Subclass is not impl.-def. *Changed NORMSQ means implementation-defined subclass, *so proceed to zero it out, if valid (0-9,A-Z) if ( (NORMSQX) = (norm2java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53 END-IF END-IF
MOVE 4 TO norm1 *examining position 4 of char array NORMSQ *valid characters are 0-9, A-Z PERFORMVARYING (NORMSQ ) then if((norm1) = ALPNUMnorm2then MOVE"0"TO NORMSQX(norm1) END-IF END-PERFORM
MOVE 5 TO norm1 *valid characters are 0-9, A-Z *examining position 5 of char array NORMSQ PERFORMVARYING norm2 PERFORMVARYINGFROM 1 BY1UNTIL > 3java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61 ifNORMSQX) =ALPNUM)) then MOVE"0"TO NORMSQX(norm1) END-IF
*implementation-defined subclasses are allowed for warnings *(class = 01). These equate to successful completion *SQLSTATE values of 00000. *Reference SQL-92 4.28 SQL-transactions, paragraph 2
if (NORMSQX(1) = "0"AND NORMSQX(2) = "1") then MOVE"0" java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17 END-IF*(class = 01). These equate to successful completion
.
java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 EXIT.
¤ Dauer der Verarbeitung: 0.15 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.