1 package net.sf.voruta;
2
3 import java.sql.*;
4 /***
5 * transforms row to array
6 * @author baliuka
7 */
8 public class VectorHandler implements ResultSetHandler {
9
10 /*** Creates a new instance of VectorHandler */
11 public VectorHandler() {
12 }
13
14 public Object handle(DbResultSet rs,Class type, Object[] params) throws Exception{
15
16 if (rs.next()) {
17 Object result = DbUtils.resultSetToArray(rs,type);
18 if(rs.next()){
19 throw new DbException("too many columns in vector query");
20 }
21 return result;
22 }else{
23 throw new DbException("no results in vector query");
24 }
25
26 }
27
28
29 }
This page was automatically generated by Maven