01: /*
02: * Copyright (C) 2005 Rob Manning
03: * manningr@users.sourceforge.net
04: *
05: * This library is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU Lesser General Public
07: * License as published by the Free Software Foundation; either
08: * version 2.1 of the License, or (at your option) any later version.
09: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: *
15: * You should have received a copy of the GNU Lesser General Public
16: * License along with this library; if not, write to the Free Software
17: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18: */
19: package net.sourceforge.squirrel_sql.plugins.dbcopy.event;
20:
21: /**
22: * Contains information about an SQL statement that was executed.
23: */
24: public class StatementEvent {
25:
26: /** the type that indicates a create table statement */
27: public static final int CREATE_TABLE_TYPE = 0;
28:
29: /** the type that indicates a create index statement */
30: public static final int CREATE_INDEX_TYPE = 1;
31:
32: public static final int CREATE_FOREIGN_KEY_TYPE = 2;
33:
34: public static final int INSERT_RECORD_TYPE = 3;
35:
36: /** the statement */
37: private String statement = null;
38:
39: /** any bind variable values. only used when type = INSERT_RECORD_TYPE */
40: private String[] bindValues;
41:
42: /** the type of the statement */
43: private int statementType = -1;
44:
45: /**
46: *
47: * @param aStatement
48: * @param type
49: */
50: public StatementEvent(String aStatement, int type) {
51: statement = aStatement;
52: statementType = type;
53: }
54:
55: /**
56: * @param statement The statement to set.
57: */
58: public void setStatement(String statement) {
59: this .statement = statement;
60: }
61:
62: /**
63: * @return Returns the statement.
64: */
65: public String getStatement() {
66: return statement;
67: }
68:
69: /**
70: * @param statementType The statementType to set.
71: */
72: public void setStatementType(int statementType) {
73: this .statementType = statementType;
74: }
75:
76: /**
77: * @return Returns the statementType.
78: */
79: public int getStatementType() {
80: return statementType;
81: }
82:
83: /**
84: * @param bindValues The bindValues to set.
85: */
86: public void setBindValues(String[] bindValues) {
87: this .bindValues = bindValues;
88: }
89:
90: /**
91: * @return Returns the bindValues.
92: */
93: public String[] getBindValues() {
94: return bindValues;
95: }
96: }
|