I'm getting "Wrapped java.lang.ArrayIndexOutOfBoundsException: -1" on DB read

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • David Rothabuer
    New Member
    • Sep 2010
    • 1

    I'm getting "Wrapped java.lang.ArrayIndexOutOfBoundsException: -1" on DB read

    I work with an integration engine that is java based. All my scripting is javascripting and I've run into a problem that I can't find a solution to.

    I am getting this error when I attempt to read from my database

    Code:
    Wrapped java.lang.ArrayIndexOutOfBoundsException: -1
    Here is the actual code (the "logger.err or" lines tell Mirth to write the output to the dashboard)

    Code:
    if (rst.EOF == true) { blnExists = false; } else { blnExists = true; }
    108: 		//If Patient is in Temp Locate table and if TL account is an SDC account
    109: 		//Need to use a nested if to avoid an error if patient isn't in the database
    
    110: 		logger.error("TEST AWARE ORU: blnExists = " + blnExists);
    
    111: 		if (blnExists == true)		{
    
    112: 			logger.error("TEST AWARE ORU : " + rst.getString('PtAcct'));
    
    113: 			if (rst.getString("PtAcct").charAt(0) == "A") {
    
    114: 				 msg['PID']['PID.18']['PID.18.1'].toString() == rst.getString('PtAcct');
    
    115: 			}
    
    116: 		}
    LINE NUMBER:	112
    DETAILS:	Wrapped java.lang.ArrayIndexOutOfBoundsException: -1

    Can anyone help? I've been working on this for a day and a half with no luck.
  • Oralloy
    Recognized Expert Contributor
    • Jun 2010
    • 988

    #2
    This is just a guess, but it looks like your recordset has no records in it, or there is no 'PtAcct' field.

    Comment

    • Dheeraj Joshi
      Recognized Expert Top Contributor
      • Jul 2009
      • 1129

      #3
      Code:
      rst.getString('PtAcct')
      You can't wrap more than one character in ' '. If it is string you must use " ".

      Code:
      rst.getString("PtAcct");
      Regards
      Dheeraj Joshi

      Comment

      Working...