01: /*
02: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: * $Id: UndefinedVirtualParameterException.java 3634 2007-01-08 21:42:24Z gbevin $
07: */
08: package com.uwyn.rife.database.exceptions;
09:
10: import com.uwyn.rife.database.DbPreparedStatement;
11:
12: public class UndefinedVirtualParameterException extends
13: DatabaseException {
14: private static final long serialVersionUID = -7004752430133818652L;
15:
16: private DbPreparedStatement mPreparedStatement = null;
17: private String mParameterName = null;
18: private int mParameterIndex = -1;
19:
20: public UndefinedVirtualParameterException(
21: DbPreparedStatement statement, String parameterName) {
22: super (
23: "The statement with sql '"
24: + statement.getSql()
25: + "' requires the definition of a value for the virtual parameter with name '"
26: + parameterName + "'.");
27: mPreparedStatement = statement;
28: mParameterName = parameterName;
29: }
30:
31: public UndefinedVirtualParameterException(
32: DbPreparedStatement statement, int parameterIndex) {
33: super (
34: "The statement with sql '"
35: + statement.getSql()
36: + "' requires the definition of a value for the virtual parameter with index '"
37: + parameterIndex + "'.");
38: mPreparedStatement = statement;
39: mParameterIndex = parameterIndex;
40: }
41:
42: public DbPreparedStatement getPreparedStatement() {
43: return mPreparedStatement;
44: }
45:
46: public String getParameterName() {
47: return mParameterName;
48: }
49:
50: public int getParameterIndex() {
51: return mParameterIndex;
52: }
53: }
|