1 package net.sf.voruta;
2
3 import java.util.*;
4 import java.lang.reflect.*;
5 /*** transforms resultset to collection of arrays
6 * @author baliuka
7 */
8 public class CollectionHandler implements ResultSetHandler{
9
10 /*** Creates a new instance of CollectionHandler */
11 public CollectionHandler() {
12 }
13
14 public Object handle(DbResultSet rs,Class type, Object[] params) throws Exception {
15 Collection result = Modifier.isAbstract(type.getModifiers()) ?
16 new Vector() : (Collection)type.newInstance();
17 while(rs.next()){
18 result.add( DbUtils.resultSetToArray(rs, Object [].class ) );
19 }
20 return result;
21 }
22
23 }
This page was automatically generated by Maven