Package org.soulwing.jdbc
Class Parameter
- java.lang.Object
-
- org.soulwing.jdbc.Parameter
-
public class Parameter extends Object
An SQL parameter injector.- Author:
- Carl Harris
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetType()Gets thetypeproperty.ObjectgetValue()Gets thevalueproperty.static Parameterin(int type, Object value)Creates a new input parameter with the given value.static Parameterin(Object value)Creates a new input parameter with the given value.voidinject(int parameterIndex, PreparedStatement statement)Injects this parameter into the given prepared statement.static Parameterinout(int type, Object value)Creates a new input/output parameter with the given type.static Parameterout(int type)Creates a new output parameter with the given type.StringtoString()StringtoString(int index)Produces a string representation of this parameter prefixed with a given index indicating its position in a parameter list.static Parameterwith(int type, Object value)Creates a new input parameter with the given value.static Parameterwith(Object value)Creates a new input parameter with the given value.
-
-
-
Method Detail
-
with
public static Parameter with(Object value)
Creates a new input parameter with the given value.Synonym for
in(Object).- Parameters:
value- value of the parameter- Returns:
- parameter object
-
with
public static Parameter with(int type, Object value)
Creates a new input parameter with the given value.Synonym for
in(int, Object).- Parameters:
type- SQL type of the parametervalue- value of the parameter- Returns:
- parameter object
-
in
public static Parameter in(Object value)
Creates a new input parameter with the given value.- Parameters:
value- value of the parameter- Returns:
- parameter object
-
in
public static Parameter in(int type, Object value)
Creates a new input parameter with the given value.Synonym for
in(Object).- Parameters:
type- SQL type of the parametervalue- value of the parameter- Returns:
- parameter object
-
out
public static Parameter out(int type)
Creates a new output parameter with the given type.- Parameters:
type- SQL type of the parameter- Returns:
- parameter object
-
inout
public static Parameter inout(int type, Object value)
Creates a new input/output parameter with the given type.- Parameters:
type- SQL type of the parametervalue- value of the parameter- Returns:
- parameter object
-
inject
public void inject(int parameterIndex, PreparedStatement statement) throws SQLExceptionInjects this parameter into the given prepared statement.- Parameters:
parameterIndex- index of the statement placeholder (starts at 1)statement- target statement- Throws:
SQLException
-
getType
public int getType()
Gets thetypeproperty.- Returns:
- property value
-
getValue
public Object getValue()
Gets thevalueproperty.- Returns:
- property value
-
toString
public String toString(int index)
Produces a string representation of this parameter prefixed with a given index indicating its position in a parameter list.- Parameters:
index- the index value to include in the representation- Returns:
- parameter description
-
-