I am trying to populate a select box from a sql model. I refered to the tip on the JATO-tips forum.
I get a reference to the model and execute the correct query. But when I try to loop through the ResultSet I get a SQLException: Closed Connection: next.
Please let me know if you ran into any similar issues. Any help is appreciated. - Thanks
Here is a sample of the code from my ViewBean (All of the commented out variations give me that same exception)
protected void populateOptionListJobStatus()
{
LookupModel model = (LookupModel)getModel(LookupModel.class);
model.clearUserWhereCriteria();
model.addUserWhereCriterion("ZLOOKUP_LOOKUP_TYPE", "Job_Status");
SimpleChoice choice;
try
{
DatasetModelExecutionContext context = this.createDefaultExecutionContext();
//ResultSet rs = model.executeSelect(this.getAutoRetrieveExecutionContext());
ResultSet rs = model.executeSelect(context);
//ResultSet rs = model.getResultSet();
//ResultSet rs = model.executeSelect(this.getLastActionExecutionContext());
System.out.println("NUMBER OF ROWS: " + model.getNumRows());
choiceArray = new Choice[model.getNumRows()];
int index = 0;
if(rs != null && model.getNumRows() > 0)
{
while(rs.next())
{