01: /*
02: * Copyright (C) 1999-2004 <a href="mailto:mandarax@jbdietrich.com">Jens Dietrich</a>
03: *
04: * This library is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 2 of the License, or (at your option) any later version.
08: *
09: * This library is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: * Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public
15: * License along with this library; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: */
18: package org.mandarax.jdbc.client;
19:
20: import java.sql.Connection;
21: import java.sql.ResultSet;
22: import java.sql.SQLException;
23:
24: import org.mandarax.jdbc.rpc.Call;
25: import org.mandarax.jdbc.rpc.Transport;
26:
27: /**
28: * Client side PreparedStatement implementation.
29: * @author <A HREF="mailto:mandarax@jbdietrich.com">Jens Dietrich</A>
30: * @version 3.3.2 <29 December 2004>
31: * @since 3.0
32: */
33: class PreparedStatementImpl extends StatementImpl implements
34: java.sql.PreparedStatement {
35:
36: /**
37: * Constructor.
38: * @param transport the transport used
39: * @param connection the connection used
40: */
41: PreparedStatementImpl(Connection connection, Transport transport) {
42: super (connection, transport);
43: }
44:
45: /**
46: * Execute the query.
47: * @return a result set
48: */
49: public ResultSet executeQuery() throws SQLException {
50: Call call = new Call(id, "PreparedStatement_executeQuery");
51: return QueryHelper.executeQuery(transport, call, fetchSize,
52: this );
53: }
54:
55: /**Generated method stub. This method is not supported by the mandarax jdbc driver.
56: * @see java.sql.PreparedStatement#clearParameters()
57: */
58: public void clearParameters() throws SQLException {
59: Call call = new Call(id, "PreparedStatement_clearParameters");
60: transport.perform(call);
61: }
62:
63: /**
64: * Set the object on a certain index.
65: * @param parameterIndex the index
66: * @param x the object
67: */
68: public void setObject(int parameterIndex, Object x)
69: throws SQLException {
70: Call call = new Call(id, "PreparedStatement_setObject",
71: new Object[] { new Integer(parameterIndex), x });
72: transport.perform(call);
73: }
74: }
|