Kevin Crowston wrote:
> By a process of binary search, I figured out the source of the null exception
> being thrown by
> the JDBC query beanshell: it was a null value in a database field. Java
> returns a null for this,
> but apparently you can't add a null to an ArrayList. So, my new code for
> handling the result set is:
>
> while (rs.next()) {
> List row = new ArrayList(numCols);
> for (int i = 0; i < numCols; i++) {
> String str = rs.getString(i + 1);
> row.add(str == null ? "null" : str);
> }
> resultList.add(row);
> }
>
> Perhaps not the best solution, but workable.
Wow that's great. I'll change the 2.1 localworker code to do this.
An alternative might be to use a LinkedList instead of the ArrayList as
LinkedList allows null. I'm not sure though what the Taverna engine
will do if it gets a list with a null in it from the service.
> Kevin Crowston
> Syracuse University Phone: +1
> (315) 464-0272
> School of Information Studies Fax: +1 (866) 265-7407
> 348 Hinds Hall Web:
> http://crowston.syr.edu/
> Syracuse, NY 13244-4100 USA
Alan
------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
taverna-users mailing list
[email protected]
[email protected]
Web site: http://www.taverna.org.uk
Mailing lists: http://www.taverna.org.uk/taverna-mailing-lists/