java.lang.ArrayIndexOutOfBoundsException: 1
Basically I am running a query where, if successful, it will just find one record and then load the resulting dataset into the form. At every point I see that the PK I am loading ‘looks’ normal. I’ve also tried changing the dataset into an array and then back into a dataset. This is something I do time and again. I have other solutions running on this same server using these same type of methods without any problem. This is driving me nuts!!
Simplified the code looks like this:
var query = "select DISTINCT ONC_REL_ID " +
"FROM JOHN_PROD.ONC_RELEASE " +
"WHERE MEDREC = ?";
var dataset = databaseManager.getDataSetByQuery('onc_patient', query, args, maxReturnedRows);
if(dataset.getMaxRowIndex() == 1)
{
var dataArray = dataset.getColumnAsArray(1);
var pks = databaseManager.convertToDataSet(dataArray)
controller.loadRecords(dataset)
It doesn’t matter if I load the ‘pks’ or the dataset I still get the same ‘ArrayIndexOutOfBounds’ error… The ‘dataArray’ variable looks like this ‘[15833]’, i.e. just a normal PK. The rest of the error log has this:
at com.servoy.j2db.dataprocessing.FoundSet.loadExternalPKList(Unknown Source)
at com.servoy.j2db.FormController.loadData(Unknown Source)
at com.servoy.j2db.FormController$JSForm.js_loadRecords(Unknown Source)
If I do a ‘Find’ on that form based on the MEDREC as above, it works without any problem but for various reasons I can’t do that. Besides it is just so illogical that it isn’t working. This is just a small solution I am doing (5 or 6 forms) that I want to complete a project before, hopefully, moving all the solutions over to Servoy 5.1. Any help gratefully received. Could it be related to a Java update? This is running Servoy 3.5.10 on an XP machine that had trouble a couple of weeks ago because of that Java release and Johan gave out a jar update to fix it. It is running Java version 1.6.0_18.