01: /*
02: * Copyright 2004-2008 H2 Group. Licensed under the H2 License, Version 1.0
03: * (http://h2database.com/html/license.html).
04: * Initial Developer: H2 Group
05: */
06: package org.h2.expression;
07:
08: import java.sql.SQLException;
09:
10: import org.h2.constant.ErrorCode;
11: import org.h2.message.Message;
12: import org.h2.value.Value;
13:
14: /**
15: * A client side (remote) parameter.
16: */
17: public class ParameterRemote implements ParameterInterface {
18:
19: private Value value;
20: private int index;
21:
22: public ParameterRemote(int index) {
23: this .index = index;
24: }
25:
26: public void setValue(Value value) {
27: this .value = value;
28: }
29:
30: public Value getParamValue() {
31: return value;
32: }
33:
34: public void checkSet() throws SQLException {
35: if (value == null) {
36: throw Message.getSQLException(
37: ErrorCode.PARAMETER_NOT_SET_1, "#" + (index + 1));
38: }
39: }
40:
41: }
|