addBatch
public void addBatch()
throws SQLException
checkOpen
protected void checkOpen()
throws SQLException
Check that this statement is still open.
- checkOpen in interface JtdsStatement
clearParameters
public void clearParameters()
throws SQLException
execute
public boolean execute()
throws SQLException
execute
public boolean execute(String arg0,
String[] arg1)
throws SQLException
- execute in interface JtdsStatement
execute
public boolean execute(String arg0,
int arg1)
throws SQLException
- execute in interface JtdsStatement
execute
public boolean execute(String arg0,
int[] arg1)
throws SQLException
- execute in interface JtdsStatement
executeMSBatch
protected SQLException executeMSBatch(int size,
int executeSize,
ArrayList counts)
throws SQLException
Execute the SQL batch on a MS server.
When running with
prepareSQL=1
or
3
, the driver will first prepare temporary stored
procedures or statements for each parameter combination found in the batch. The handles to these pre-preared
statements will then be used to execute the actual batch statements.
- executeMSBatch in interface JtdsStatement
size
- the total size of the batchexecuteSize
- the maximum number of statements to send in one requestcounts
- the returned update counts
- chained exceptions linked to a
SQLException
executeQuery
public ResultSet executeQuery()
throws SQLException
executeSybaseBatch
protected SQLException executeSybaseBatch(int size,
int executeSize,
ArrayList counts)
throws SQLException
Execute the SQL batch on a Sybase server.
Sybase needs to have the SQL concatenated into one TDS language packet followed by up to 1000 parameters. This
method will be overriden for
CallableStatements
.
- executeSybaseBatch in interface JtdsStatement
size
- the total size of the batchexecuteSize
- the maximum number of statements to send in one requestcounts
- the returned update counts
- chained exceptions linked to a
SQLException
executeUpdate
public int executeUpdate()
throws SQLException
getMetaData
public ResultSetMetaData getMetaData()
throws SQLException
getParameter
protected ParamInfo getParameter(int parameterIndex)
throws SQLException
Check the supplied index and return the selected parameter.
parameterIndex
- the parameter index 1 to n.
- the parameter as a
ParamInfo
object.
getParameterMetaData
public ParameterMetaData getParameterMetaData()
throws SQLException
normalizeCall
protected static String normalizeCall(String sql)
This method converts native call syntax into (hopefully) valid JDBC
escape syntax.
Note: This method is required for backwards compatibility with
previous versions of jTDS. Strictly speaking only the JDBC syntax needs
to be recognised, constructions such as "?=#testproc ?,?" are neither
valid native syntax nor valid escapes. All the substrings and trims
below are not as bad as they look. The objects created all refer back to
the original sql string it is just the start and length positions which
change.
sql
- the SQL statement to process
- the SQL, possibly in original form
notSupported
protected void notSupported(String method)
throws SQLException
Report that user tried to call a method not supported on this type of statement.
method
- The method name to report in the error message.
setArray
public void setArray(int arg0,
Array arg1)
throws SQLException
setAsciiStream
public void setAsciiStream(int parameterIndex,
InputStream inputStream,
int length)
throws SQLException
setBigDecimal
public void setBigDecimal(int parameterIndex,
BigDecimal x)
throws SQLException
setBinaryStream
public void setBinaryStream(int parameterIndex,
InputStream x,
int length)
throws SQLException
setBlob
public void setBlob(int parameterIndex,
Blob x)
throws SQLException
setBoolean
public void setBoolean(int parameterIndex,
boolean x)
throws SQLException
setByte
public void setByte(int parameterIndex,
byte x)
throws SQLException
setBytes
public void setBytes(int parameterIndex,
byte[] x)
throws SQLException
setCharacterStream
public void setCharacterStream(int parameterIndex,
Reader reader,
int length)
throws SQLException
setClob
public void setClob(int parameterIndex,
Clob x)
throws SQLException
setColMetaData
(package private) void setColMetaData(ColInfo[] value)
Update the cached column meta data information.
value
- The Column meta data array.
setDate
public void setDate(int parameterIndex,
Date x)
throws SQLException
setDate
public void setDate(int parameterIndex,
Date x,
Calendar cal)
throws SQLException
setDouble
public void setDouble(int parameterIndex,
double x)
throws SQLException
setFloat
public void setFloat(int parameterIndex,
float x)
throws SQLException
setInt
public void setInt(int parameterIndex,
int x)
throws SQLException
setLong
public void setLong(int parameterIndex,
long x)
throws SQLException
setNull
public void setNull(int parameterIndex,
int sqlType)
throws SQLException
setNull
public void setNull(int parameterIndex,
int sqlType,
String typeName)
throws SQLException
setObject
public void setObject(int parameterIndex,
Object x)
throws SQLException
setObject
public void setObject(int parameterIndex,
Object x,
int targetSqlType)
throws SQLException
setObject
public void setObject(int parameterIndex,
Object x,
int targetSqlType,
int scale)
throws SQLException
setObjectBase
public void setObjectBase(int parameterIndex,
Object x,
int targetSqlType,
int scale)
throws SQLException
Generic setObject method.
parameterIndex
- Parameter index 1 to n.x
- The value to set.targetSqlType
- The java.sql.Types constant describing the data.scale
- The decimal scale -1 if not set.
setParamMetaData
(package private) void setParamMetaData(ParamInfo[] value)
Update the cached parameter meta data information.
value
- The Column meta data array.
setParameter
protected void setParameter(int parameterIndex,
Object x,
int targetSqlType,
int scale,
int length)
throws SQLException
Update the ParamInfo object for the specified parameter.
parameterIndex
- Parameter index 1 to n.x
- The value to set.targetSqlType
- The java.sql.Types constant describing the data.scale
- The decimal scale -1 if not set.length
- The length of the data item.
setRef
public void setRef(int parameterIndex,
Ref x)
throws SQLException
setShort
public void setShort(int parameterIndex,
short x)
throws SQLException
setString
public void setString(int parameterIndex,
String x)
throws SQLException
setTime
public void setTime(int parameterIndex,
Time x)
throws SQLException
setTime
public void setTime(int parameterIndex,
Time x,
Calendar cal)
throws SQLException
setTimestamp
public void setTimestamp(int parameterIndex,
Timestamp x)
throws SQLException
setTimestamp
public void setTimestamp(int parameterIndex,
Timestamp x,
Calendar cal)
throws SQLException
setURL
public void setURL(int parameterIndex,
URL url)
throws SQLException
setUnicodeStream
public void setUnicodeStream(int parameterIndex,
InputStream inputStream,
int length)
throws SQLException