public final class MonetDBEmbeddedPreparedStatement extends AbstractConnectionResult
Modifier and Type | Method and Description |
---|---|
void |
clearParameters()
Clears the current parameter values immediately.
|
void |
close()
Close the result set.
|
protected void |
closeResultImplementation()
Close the result set internally.
|
boolean |
execute()
Executes the SQL statement in this PreparedStatement object, which may be any kind of SQL statement.
|
void |
executeAndIgnore()
Like the previous one, but without returning any result.
|
QueryResultSet |
executeQuery()
Executes the SQL query in this PreparedStatement object and returns QueryResultSet ResultSet object generated by
the query.
|
int |
executeUpdate()
Executes the SQL statement in this PreparedStatement object, which must be an SQL INSERT, UPDATE or DELETE
statement; or an SQL statement that returns nothing, such as a DDL statement.
|
void |
getColumnDigits(int[] input)
Gets the column digits as an integer array.
|
void |
getColumnNames(String[] input)
Gets the columns names as a string array.
|
void |
getColumnScales(int[] input)
Gets the column scales as an integer array.
|
void |
getColumnTypes(String[] input)
Gets the columns types as a string array.
|
void |
getMappings(MonetDBToJavaMapping[] input)
Gets the Java mappings as a MonetDBToJavaMapping array.
|
ResultSetMetaData |
getMetaData()
Retrieves a ResultSetMetaData object that contains information
about the columns of the ResultSet object that will be returned
when this PreparedStatement object is executed.
|
int |
getNumberOfColumns()
Returns the number of columns in the result set.
|
int |
getNumberOfRows()
Returns the number of rows in the result set.
|
ParameterMetaData |
getParameterMetaData()
Retrieves the number, types and properties of this PreparedStatement object's parameters.
|
boolean |
isPreparedStatementClosed()
Tells if the prepared statement was closed or not
|
void |
setBigDecimal(int idx,
BigDecimal x)
Sets the designated parameter to the given java.math.BigDecimal value.
|
void |
setBlob(int parameterIndex,
Blob x)
Sets the designated parameter to the given Blob object.
|
void |
setBoolean(int parameterIndex,
boolean x)
Sets the designated parameter to the given Java boolean value.
|
void |
setByte(int parameterIndex,
byte x)
Sets the designated parameter to the given Java byte value.
|
void |
setBytes(int parameterIndex,
byte[] x)
Sets the designated parameter to the given Java array of bytes.
|
void |
setClob(int i,
Clob x)
Sets the designated parameter to the given Clob object.
|
void |
setDate(int parameterIndex,
Date x)
Sets the designated parameter to the given java.sql.Date value.
|
void |
setDate(int parameterIndex,
Date x,
Calendar cal)
Sets the designated parameter to the given java.sql.Date value, using
the given Calendar object.
|
void |
setDouble(int parameterIndex,
double x)
Sets the designated parameter to the given Java double value.
|
void |
setFloat(int parameterIndex,
float x)
Sets the designated parameter to the given Java float value.
|
void |
setInt(int parameterIndex,
int x)
Sets the designated parameter to the given Java int value.
|
void |
setLong(int parameterIndex,
long x)
Sets the designated parameter to the given Java long value.
|
void |
setNull(int parameterIndex,
int sqlType)
Sets the designated parameter to SQL NULL.
|
void |
setNull(int paramIndex,
int sqlType,
String typeName)
Sets the designated parameter to SQL NULL.
|
void |
setObject(int index,
Object x)
Sets the value of the designated parameter using the given object.
|
void |
setObject(int parameterIndex,
Object x,
int targetSqlType)
Sets the value of the designated parameter with the given object.
|
void |
setObject(int parameterIndex,
Object x,
int targetSqlType,
int scale)
Sets the value of the designated parameter with the given object.
|
void |
setShort(int parameterIndex,
short x)
Sets the designated parameter to the given Java short value.
|
void |
setString(int parameterIndex,
String x)
Sets the designated parameter to the given Java String value.
|
void |
setTime(int index,
Time x)
Sets the designated parameter to the given java.sql.Time value.
|
void |
setTime(int index,
Time x,
Calendar cal)
Sets the designated parameter to the given java.sql.Time value,
using the given Calendar object.
|
void |
setTimestamp(int index,
Timestamp x)
Sets the designated parameter to the given java.sql.Timestamp value.
|
void |
setTimestamp(int index,
Timestamp x,
Calendar cal)
Sets the designated parameter to the given java.sql.Timestamp
value, using the given Calendar object.
|
void |
setURL(int parameterIndex,
URL x)
Sets the designated parameter to the given java.net.URL value.
|
checkMetadataArrayLength, finalize, getConnection, getRandomIdentifier
public int getNumberOfColumns()
AbstractConnectionResult
getNumberOfColumns
in class AbstractConnectionResult
public int getNumberOfRows()
AbstractConnectionResult
getNumberOfRows
in class AbstractConnectionResult
public void getColumnNames(String[] input) throws MonetDBEmbeddedException
AbstractConnectionResult
getColumnNames
in class AbstractConnectionResult
input
- The columns names array to fill.MonetDBEmbeddedException
- If an error in the database occurred.public void getColumnTypes(String[] input) throws MonetDBEmbeddedException
AbstractConnectionResult
getColumnTypes
in class AbstractConnectionResult
input
- The columns types array to fill.MonetDBEmbeddedException
- If an error in the database occurred.public void getMappings(MonetDBToJavaMapping[] input) throws MonetDBEmbeddedException
AbstractConnectionResult
getMappings
in class AbstractConnectionResult
input
- The columns mappings array to fill.MonetDBEmbeddedException
- If an error in the database occurred..public void getColumnDigits(int[] input) throws MonetDBEmbeddedException
AbstractConnectionResult
getColumnDigits
in class AbstractConnectionResult
input
- The columns digits array to fill.MonetDBEmbeddedException
- If an error in the database occurred.public void getColumnScales(int[] input) throws MonetDBEmbeddedException
AbstractConnectionResult
getColumnScales
in class AbstractConnectionResult
input
- The columns scales array to fill.MonetDBEmbeddedException
- If an error in the database occurred.public boolean isPreparedStatementClosed()
public void clearParameters()
public boolean execute() throws MonetDBEmbeddedException
MonetDBEmbeddedException
- if a database access error occurspublic void executeAndIgnore() throws MonetDBEmbeddedException
MonetDBEmbeddedException
- if a database access error occurspublic QueryResultSet executeQuery() throws MonetDBEmbeddedException
MonetDBEmbeddedException
- if a database access error occurs or the SQL statement does not return a
QueryResultSetpublic int executeUpdate() throws MonetDBEmbeddedException
MonetDBEmbeddedException
- if a database access error occurs or the SQL statement returns a ResultSetpublic void setNull(int parameterIndex, int sqlType) throws MonetDBEmbeddedException
parameterIndex
- the first parameter is 1, the second is 2, ...sqlType
- the SQL type code defined in java.sql.TypesMonetDBEmbeddedException
- if a database access error occurspublic void setNull(int paramIndex, int sqlType, String typeName) throws MonetDBEmbeddedException
paramIndex
- the first parameter is 1, the second is 2, ...sqlType
- a value from java.sql.TypestypeName
- the fully-qualified name of an SQL user-defined type; ignored if the parameter is not a
user-defined type or REFMonetDBEmbeddedException
- if a database access error occurspublic void setBigDecimal(int idx, BigDecimal x) throws MonetDBEmbeddedException
idx
- the first parameter is 1, the second is 2, ...x
- the parameter valueMonetDBEmbeddedException
- if a database access error occurspublic void setBlob(int parameterIndex, Blob x) throws MonetDBEmbeddedException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- a Blob object that maps an SQL BLOB valueMonetDBEmbeddedException
- if a database access error occurspublic void setBoolean(int parameterIndex, boolean x) throws MonetDBEmbeddedException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valueMonetDBEmbeddedException
- if a database access error occurspublic void setByte(int parameterIndex, byte x) throws MonetDBEmbeddedException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valueMonetDBEmbeddedException
- if a database access error occurspublic void setBytes(int parameterIndex, byte[] x) throws MonetDBEmbeddedException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valueMonetDBEmbeddedException
- if a database access error occurspublic void setClob(int i, Clob x) throws MonetDBEmbeddedException
i
- the first parameter is 1, the second is 2, ...x
- a Clob object that maps an SQL CLOB valueMonetDBEmbeddedException
- if a database access error occurspublic void setDate(int parameterIndex, Date x) throws MonetDBEmbeddedException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valueMonetDBEmbeddedException
- if a database access error occurspublic void setDate(int parameterIndex, Date x, Calendar cal) throws MonetDBEmbeddedException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuecal
- the Calendar object the driver will use to construct the dateMonetDBEmbeddedException
- if a database access error occurspublic void setDouble(int parameterIndex, double x) throws MonetDBEmbeddedException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valueMonetDBEmbeddedException
- if a database access error occurspublic void setFloat(int parameterIndex, float x) throws MonetDBEmbeddedException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valueMonetDBEmbeddedException
- if a database access error occurspublic void setInt(int parameterIndex, int x) throws MonetDBEmbeddedException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valueMonetDBEmbeddedException
- if a database access error occurspublic void setLong(int parameterIndex, long x) throws MonetDBEmbeddedException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valueMonetDBEmbeddedException
- if a database access error occurspublic void setObject(int index, Object x) throws MonetDBEmbeddedException
index
- the first parameter is 1, the second is 2, ...x
- the object containing the input parameter valueMonetDBEmbeddedException
- if a database access error occurs or the type of the given object is ambiguouspublic void setObject(int parameterIndex, Object x, int targetSqlType) throws MonetDBEmbeddedException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the object containing the input parameter valuetargetSqlType
- the Java ordinal value from MonetDBToJavaMappingMonetDBEmbeddedException
- if a database access error occurspublic void setObject(int parameterIndex, Object x, int targetSqlType, int scale) throws MonetDBEmbeddedException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the object containing the input parameter valuetargetSqlType
- the Java ordinal value from MonetDBToJavaMappingscale
- for java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types, this is the number of digits after the
decimal point. For Java Object types InputStream and Reader, this is the length of the data in the
stream or reader. For all other types, this value will be ignored.MonetDBEmbeddedException
- if a database access error occursTypes
public void setShort(int parameterIndex, short x) throws MonetDBEmbeddedException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valueMonetDBEmbeddedException
- if a database access error occurspublic void setString(int parameterIndex, String x) throws MonetDBEmbeddedException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valueMonetDBEmbeddedException
- if a database access error occurspublic void setTime(int index, Time x) throws MonetDBEmbeddedException
index
- the first parameter is 1, the second is 2, ...x
- the parameter valueMonetDBEmbeddedException
- if a database access error occurspublic void setTime(int index, Time x, Calendar cal) throws MonetDBEmbeddedException
index
- the first parameter is 1, the second is 2, ...x
- the parameter valuecal
- the Calendar object the driver will use to construct the timeMonetDBEmbeddedException
- if a database access error occurspublic void setTimestamp(int index, Timestamp x) throws MonetDBEmbeddedException
index
- the first parameter is 1, the second is 2, ...x
- the parameter valueMonetDBEmbeddedException
- if a database access error occurspublic void setTimestamp(int index, Timestamp x, Calendar cal) throws MonetDBEmbeddedException
index
- the first parameter is 1, the second is 2, ...x
- the parameter valuecal
- the Calendar object the driver will use to construct the timestampMonetDBEmbeddedException
- if a database access error occurspublic void setURL(int parameterIndex, URL x) throws MonetDBEmbeddedException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the java.net.URL object to be setMonetDBEmbeddedException
- if a database access error occurspublic ResultSetMetaData getMetaData()
public ParameterMetaData getParameterMetaData() throws SQLException
SQLException
- if a database access error occurspublic void close()
AbstractConnectionResult
close
in interface Closeable
close
in interface AutoCloseable
close
in class AbstractConnectionResult
protected void closeResultImplementation()
AbstractConnectionResult
closeResultImplementation
in class AbstractConnectionResult
Copyright © 2018. All rights reserved.