01: package org.mandarax.jdbc.client;
02:
03: /*
04: * Copyright (C) 1999-2004 <a href="mailto:mandarax@jbdietrich.com">Jens Dietrich</a>
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * version 2 of the License, or (at your option) any later version.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: * You should have received a copy of the GNU Lesser General Public
17: * License along with this library; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19: */
20:
21: import java.sql.*;
22:
23: import org.mandarax.jdbc.server.PseudoColumns;
24:
25: /**
26: * A single record in a jdbc result set.
27: * @author <A HREF="mailto:mandarax@jbdietrich.com">Jens Dietrich</A>
28: * @version 3.3.2 <29 December 2004>
29: * @since 3.0
30: */
31: public class Record {
32: private Object[] values = null;
33:
34: /**
35: * Constructor.
36: * @param rs a result set
37: */
38: public Record(ResultSet rs) throws SQLException {
39: super ();
40: ResultSetMetaData metaData = rs.getMetaData();
41: int s = metaData.getColumnCount();
42: if (metaData instanceof org.mandarax.jdbc.server.ResultSetMetaDataImpl)
43: s = s - PseudoColumns.PSEUDO_COLUMNS.length;
44: values = new Object[s];
45: for (int i = 0; i < s; i++) {
46: values[i] = rs.getObject(i + 1);
47: }
48: }
49:
50: /**
51: * Constructor.
52: */
53: public Record() throws SQLException {
54: super ();
55: }
56:
57: /**
58: * Get the values.
59: * @return
60: */
61: public Object[] getValues() {
62: return values;
63: }
64:
65: /**
66: * Set the values.
67: * @param values
68: */
69: public void setValues(Object[] values) {
70: this.values = values;
71: }
72:
73: }
|