franta-hg@16: /** franta-hg@16: * SQL-DK franta-hg@16: * Copyright © 2013 František Kučera (frantovo.cz) franta-hg@16: * franta-hg@16: * This program is free software: you can redistribute it and/or modify franta-hg@16: * it under the terms of the GNU General Public License as published by franta-hg@16: * the Free Software Foundation, either version 3 of the License, or franta-hg@16: * (at your option) any later version. franta-hg@16: * franta-hg@16: * This program is distributed in the hope that it will be useful, franta-hg@16: * but WITHOUT ANY WARRANTY; without even the implied warranty of franta-hg@16: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the franta-hg@16: * GNU General Public License for more details. franta-hg@16: * franta-hg@16: * You should have received a copy of the GNU General Public License franta-hg@16: * along with this program. If not, see . franta-hg@16: */ franta-hg@1: package info.globalcode.sql.dk; franta-hg@1: franta-hg@4: import java.sql.Types; franta-hg@4: franta-hg@1: /** franta-hg@155: * Parameter for {@linkplain SQLCommand} franta-hg@1: * franta-hg@1: * @author Ing. František Kučera (frantovo.cz) franta-hg@1: */ franta-hg@1: public class Parameter { franta-hg@1: franta-hg@4: /** franta-hg@4: * @see Types franta-hg@4: */ franta-hg@68: public static final SQLType DEFAULT_TYPE = SQLType.VARCHAR; franta-hg@1: private Object value; franta-hg@68: private SQLType type; franta-hg@1: franta-hg@4: public Parameter() { franta-hg@4: } franta-hg@4: franta-hg@68: public Parameter(Object value, SQLType type) { franta-hg@4: this.value = value; franta-hg@4: if (type == null) { franta-hg@4: this.type = DEFAULT_TYPE; franta-hg@4: } else { franta-hg@4: this.type = type; franta-hg@4: } franta-hg@4: } franta-hg@4: franta-hg@1: public Object getValue() { franta-hg@1: return value; franta-hg@1: } franta-hg@1: franta-hg@1: public void setValue(Object value) { franta-hg@1: this.value = value; franta-hg@1: } franta-hg@1: franta-hg@1: /** franta-hg@1: * @see java.sql.Types franta-hg@1: */ franta-hg@68: public SQLType getType() { franta-hg@1: return type; franta-hg@1: } franta-hg@1: franta-hg@1: /** franta-hg@1: * @see java.sql.Types franta-hg@1: */ franta-hg@68: public void setType(SQLType type) { franta-hg@1: this.type = type; franta-hg@1: } franta-hg@1: }