|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.jtds.jdbc.ParamInfo
This class is a descriptor for procedure and prepared statement parameters.
Field Summary | |
(package private) CharsetInfo |
charsetInfo
Character set descriptor (if different from default) |
(package private) byte[] |
collation
TDS 8 Collation string. |
(package private) static int |
INPUT
Flag as an input parameter. |
(package private) boolean |
isOutput
Parameter is an output parameter |
(package private) boolean |
isRetVal
Parameter is used as SP return value |
(package private) boolean |
isSet
IN parameter has been set |
(package private) boolean |
isSetOut
OUT parameter value is set. |
(package private) boolean |
isUnicode
Parameter should be sent as unicode |
(package private) int |
jdbcType
JDBC type constant from java.sql.Types |
(package private) int |
length
Length of InputStream |
(package private) int |
markerPos
Parameter offset in target SQL statement |
(package private) java.lang.String |
name
Formal parameter name eg @P1 |
(package private) static int |
OUTPUT
Flag as an output parameter. |
(package private) java.lang.Object |
outValue
OUT Parameter value. |
(package private) int |
precision
Parameter decimal precision |
(package private) static int |
RETVAL
Flag as an return value parameter. |
(package private) int |
scale
Parameter decimal scale |
(package private) java.lang.String |
sqlType
SQL type name eg varchar(10) |
(package private) int |
tdsType
Internal TDS data type |
(package private) static int |
UNICODE
Flag as a unicode parameter. |
(package private) java.lang.Object |
value
Current parameter value |
Constructor Summary | |
(package private) |
ParamInfo(ColInfo ci,
java.lang.String name,
java.lang.Object value,
int length)
Construct a parameter based on a result set column. |
(package private) |
ParamInfo(int pos,
boolean isUnicode)
Construct a parameter with parameter marker offset. |
(package private) |
ParamInfo(int jdbcType,
java.lang.Object value,
int flags)
Construct an initialised parameter with extra attributes. |
(package private) |
ParamInfo(java.lang.String name,
int pos,
boolean isRetVal,
boolean isUnicode)
Construct a parameter for statement caching. |
Method Summary | |
(package private) void |
clearInValue()
Clear the IN parameter value and status. |
(package private) void |
clearOutValue()
Clear the OUT parameter value and status. |
java.lang.Object |
clone()
Creates a shallow copy of this ParamInfo instance. |
(package private) byte[] |
getBytes(java.lang.String charset)
Get the byte array value of the parameter. |
(package private) java.lang.Object |
getOutValue()
Get the output parameter value. |
(package private) java.lang.String |
getString(java.lang.String charset)
Get the string value of the parameter. |
private static java.lang.String |
loadFromReader(java.io.Reader in,
int length)
Create a String from a Reader stream. |
private static byte[] |
loadFromStream(java.io.InputStream in,
int length)
Load a byte array from an InputStream |
(package private) void |
setOutValue(java.lang.Object value)
Set the OUT parameter value. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
static final int INPUT
static final int OUTPUT
static final int RETVAL
static final int UNICODE
int tdsType
int jdbcType
java.lang.String name
java.lang.String sqlType
int markerPos
java.lang.Object value
int precision
int scale
int length
boolean isOutput
boolean isRetVal
boolean isSet
boolean isUnicode
byte[] collation
CharsetInfo charsetInfo
boolean isSetOut
java.lang.Object outValue
Constructor Detail |
ParamInfo(int pos, boolean isUnicode)
pos
- the offset of the ? symbol in the target SQL stringisUnicode
- true
if the parameter is Unicode encodedParamInfo(java.lang.String name, int pos, boolean isRetVal, boolean isUnicode)
name
- the formal name of the parameterpos
- the offset of the ? symbol in the parsed SQL stringisRetVal
- true
if the parameter is a return valueisUnicode
- true
if the parameter is Unicode encodedParamInfo(int jdbcType, java.lang.Object value, int flags)
jdbcType
- the java.sql.Type
constant describing this typevalue
- the initial parameter valueflags
- the additional attributes eg OUTPUT, RETVAL, UNICODE etc.ParamInfo(ColInfo ci, java.lang.String name, java.lang.Object value, int length)
ci
- the column descriptorname
- the name for this parameter or nullvalue
- the column data valuelength
- the column data lengthMethod Detail |
java.lang.Object getOutValue() throws java.sql.SQLException
Object
java.sql.SQLException
- if the parameter has not been setvoid setOutValue(java.lang.Object value)
value
- The data value.void clearOutValue()
void clearInValue()
java.lang.String getString(java.lang.String charset) throws java.io.IOException
String
or null.
java.io.IOException
byte[] getBytes(java.lang.String charset) throws java.io.IOException
byte[]
or null.
java.io.IOException
private static byte[] loadFromStream(java.io.InputStream in, int length) throws java.io.IOException
in
- The InputStream to read from.length
- The length of the stream.
byte[]
.
java.io.IOException
private static java.lang.String loadFromReader(java.io.Reader in, int length) throws java.io.IOException
in
- The Reader object with the data.length
- Number of characters to read.
String
.
java.io.IOException
public java.lang.Object clone()
ParamInfo
instance. Used by
the PreparedStatement
batching implementation to duplicate
parameters.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |