author | František Kučera <franta-hg@frantovo.cz> |
Sat, 04 Jan 2014 22:38:59 +0100 | |
branch | v_0 |
changeset 134 | f2510551b5bf |
parent 68 | 574cd7fbb5b2 |
child 155 | eb3676c6929b |
permissions | -rw-r--r-- |
franta-hg@16 | 1 |
/** |
franta-hg@16 | 2 |
* SQL-DK |
franta-hg@16 | 3 |
* Copyright © 2013 František Kučera (frantovo.cz) |
franta-hg@16 | 4 |
* |
franta-hg@16 | 5 |
* This program is free software: you can redistribute it and/or modify |
franta-hg@16 | 6 |
* it under the terms of the GNU General Public License as published by |
franta-hg@16 | 7 |
* the Free Software Foundation, either version 3 of the License, or |
franta-hg@16 | 8 |
* (at your option) any later version. |
franta-hg@16 | 9 |
* |
franta-hg@16 | 10 |
* This program is distributed in the hope that it will be useful, |
franta-hg@16 | 11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
franta-hg@16 | 12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
franta-hg@16 | 13 |
* GNU General Public License for more details. |
franta-hg@16 | 14 |
* |
franta-hg@16 | 15 |
* You should have received a copy of the GNU General Public License |
franta-hg@16 | 16 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
franta-hg@16 | 17 |
*/ |
franta-hg@1 | 18 |
package info.globalcode.sql.dk; |
franta-hg@1 | 19 |
|
franta-hg@4 | 20 |
import java.sql.Types; |
franta-hg@4 | 21 |
|
franta-hg@1 | 22 |
/** |
franta-hg@1 | 23 |
* |
franta-hg@1 | 24 |
* @author Ing. František Kučera (frantovo.cz) |
franta-hg@1 | 25 |
*/ |
franta-hg@1 | 26 |
public class Parameter { |
franta-hg@1 | 27 |
|
franta-hg@4 | 28 |
/** |
franta-hg@4 | 29 |
* @see Types |
franta-hg@4 | 30 |
*/ |
franta-hg@68 | 31 |
public static final SQLType DEFAULT_TYPE = SQLType.VARCHAR; |
franta-hg@1 | 32 |
private Object value; |
franta-hg@68 | 33 |
private SQLType type; |
franta-hg@1 | 34 |
|
franta-hg@4 | 35 |
public Parameter() { |
franta-hg@4 | 36 |
} |
franta-hg@4 | 37 |
|
franta-hg@68 | 38 |
public Parameter(Object value, SQLType type) { |
franta-hg@4 | 39 |
this.value = value; |
franta-hg@4 | 40 |
if (type == null) { |
franta-hg@4 | 41 |
this.type = DEFAULT_TYPE; |
franta-hg@4 | 42 |
} else { |
franta-hg@4 | 43 |
this.type = type; |
franta-hg@4 | 44 |
} |
franta-hg@4 | 45 |
} |
franta-hg@4 | 46 |
|
franta-hg@1 | 47 |
public Object getValue() { |
franta-hg@1 | 48 |
return value; |
franta-hg@1 | 49 |
} |
franta-hg@1 | 50 |
|
franta-hg@1 | 51 |
public void setValue(Object value) { |
franta-hg@1 | 52 |
this.value = value; |
franta-hg@1 | 53 |
} |
franta-hg@1 | 54 |
|
franta-hg@1 | 55 |
/** |
franta-hg@1 | 56 |
* @see java.sql.Types |
franta-hg@1 | 57 |
*/ |
franta-hg@68 | 58 |
public SQLType getType() { |
franta-hg@1 | 59 |
return type; |
franta-hg@1 | 60 |
} |
franta-hg@1 | 61 |
|
franta-hg@1 | 62 |
/** |
franta-hg@1 | 63 |
* @see java.sql.Types |
franta-hg@1 | 64 |
*/ |
franta-hg@68 | 65 |
public void setType(SQLType type) { |
franta-hg@1 | 66 |
this.type = type; |
franta-hg@1 | 67 |
} |
franta-hg@1 | 68 |
} |