001: /*
002: * ProcedureParameter.java
003: *
004: * Copyright (C) 2002, 2003, 2004, 2005, 2006 Takis Diakoumis
005: *
006: * This program is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU General Public License
008: * as published by the Free Software Foundation; either version 2
009: * of the License, or any later version.
010: *
011: * This program is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
014: * GNU General Public License for more details.
015: *
016: * You should have received a copy of the GNU General Public License
017: * along with this program; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
019: *
020: */
021:
022: package org.executequery.databasemediators;
023:
024: import java.sql.DatabaseMetaData;
025:
026: /* ----------------------------------------------------------
027: * CVS NOTE: Changes to the CVS repository prior to the
028: * release of version 3.0.0beta1 has meant a
029: * resetting of CVS revision numbers.
030: * ----------------------------------------------------------
031: */
032:
033: /**
034: *
035: * @author Takis Diakoumis
036: * @version $Revision: 1.4 $
037: * @date $Date: 2006/05/14 06:56:54 $
038: */
039: public class ProcedureParameter {
040:
041: private String name;
042: private int type;
043: private int dataType;
044: private String sqlType;
045: private int size;
046: private String value;
047:
048: private static final String RESULT_STORE = "< Result Store >";
049: private static final String RETURN_VALUE = "< Return Value >";
050: private static final String UNKNOWN = "< Unknown >";
051:
052: public ProcedureParameter(String name, int type, int dataType,
053: String sqlType, int size) {
054: this .name = name;
055: this .type = type;
056: this .dataType = dataType;
057: this .sqlType = sqlType;
058: this .size = size;
059: }
060:
061: public void setDataType(int dataType) {
062: this .dataType = dataType;
063: }
064:
065: public int getDataType() {
066: return dataType;
067: }
068:
069: public void setSize(int size) {
070: this .size = size;
071: }
072:
073: public int getSize() {
074: return size;
075: }
076:
077: public void setSqlType(String sqlType) {
078: this .sqlType = sqlType;
079: }
080:
081: public String getSqlType() {
082: return sqlType;
083: }
084:
085: public void setType(int type) {
086: this .type = type;
087: }
088:
089: public int getType() {
090: return type;
091: }
092:
093: public void setValue(String value) {
094: this .value = value;
095: }
096:
097: public String getValue() {
098: return value;
099: }
100:
101: public void setName(String name) {
102: this .name = name;
103: }
104:
105: public String getName() {
106:
107: if (name == null) {
108:
109: if (type == DatabaseMetaData.procedureColumnResult)
110: return RESULT_STORE;
111:
112: else if (type == DatabaseMetaData.procedureColumnReturn)
113: return RETURN_VALUE;
114:
115: else
116: return UNKNOWN;
117:
118: }
119:
120: return name;
121: }
122:
123: public String toString() {
124: return getName();
125: }
126:
127: }
|