|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.armatiek.infofuze.source.jdbc.NamedParameterStatement
public class NamedParameterStatement
| Constructor Summary | |
|---|---|
NamedParameterStatement(java.sql.Connection connection,
java.lang.String query)
Creates a NamedParameterStatement. |
|
| Method Summary | |
|---|---|
void |
addBatch()
Adds the current set of parameters as a batch entry. |
void |
close()
Closes the statement. |
boolean |
execute()
Executes the statement. |
int[] |
executeBatch()
Executes all of the batched statements. |
java.sql.ResultSet |
executeQuery()
Executes the statement, which must be a query. |
int |
executeUpdate()
Executes the statement, which must be an SQL INSERT, UPDATE or DELETE statement; or an SQL statement that returns nothing, such as a DDL statement. |
java.sql.PreparedStatement |
getStatement()
Returns the underlying statement. |
void |
setBoolean(java.lang.String name,
java.lang.Boolean value)
Sets a parameter. |
void |
setDouble(java.lang.String name,
java.lang.Double value)
Sets a parameter. |
void |
setInt(java.lang.String name,
int value)
Sets a parameter. |
void |
setLong(java.lang.String name,
long value)
Sets a parameter. |
void |
setObject(java.lang.String name,
java.lang.Object value)
Sets a parameter. |
void |
setString(java.lang.String name,
java.lang.String value)
Sets a parameter. |
void |
setTimestamp(java.lang.String name,
java.sql.Timestamp value)
Sets a parameter. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NamedParameterStatement(java.sql.Connection connection,
java.lang.String query)
throws java.sql.SQLException
prepareStatement.
connection - the database connectionquery - the parameterized query
java.sql.SQLException - if the statement could not be created| Method Detail |
|---|
public void setObject(java.lang.String name,
java.lang.Object value)
throws java.sql.SQLException
name - parameter namevalue - parameter value
java.sql.SQLException - if an error occurred
java.lang.IllegalArgumentException - if the parameter does not existPreparedStatement.setObject(int, java.lang.Object)
public void setString(java.lang.String name,
java.lang.String value)
throws java.sql.SQLException
name - parameter namevalue - parameter value
java.sql.SQLException - if an error occurred
java.lang.IllegalArgumentException - if the parameter does not existPreparedStatement.setString(int, java.lang.String)
public void setInt(java.lang.String name,
int value)
throws java.sql.SQLException
name - parameter namevalue - parameter value
java.sql.SQLException - if an error occurred
java.lang.IllegalArgumentException - if the parameter does not existPreparedStatement.setInt(int, int)
public void setLong(java.lang.String name,
long value)
throws java.sql.SQLException
name - parameter namevalue - parameter value
java.sql.SQLException - if an error occurred
java.lang.IllegalArgumentException - if the parameter does not existPreparedStatement.setInt(int, int)
public void setTimestamp(java.lang.String name,
java.sql.Timestamp value)
throws java.sql.SQLException
name - parameter namevalue - parameter value
java.sql.SQLException - if an error occurred
java.lang.IllegalArgumentException - if the parameter does not existPreparedStatement.setTimestamp(int, java.sql.Timestamp)
public void setDouble(java.lang.String name,
java.lang.Double value)
throws java.sql.SQLException
name - parameter namevalue - parameter value
java.sql.SQLException - if an error occurred
java.lang.IllegalArgumentException - if the parameter does not existPreparedStatement#setTimestamp(int, java.lang.Double)
public void setBoolean(java.lang.String name,
java.lang.Boolean value)
throws java.sql.SQLException
name - parameter namevalue - parameter value
java.sql.SQLException - if an error occurred
java.lang.IllegalArgumentException - if the parameter does not existPreparedStatement#setTimestamp(int, java.lang.Boolean)public java.sql.PreparedStatement getStatement()
public boolean execute()
throws java.sql.SQLException
ResultSet
java.sql.SQLException - if an error occurredPreparedStatement.execute()
public java.sql.ResultSet executeQuery()
throws java.sql.SQLException
java.sql.SQLException - if an error occurredPreparedStatement.executeQuery()
public int executeUpdate()
throws java.sql.SQLException
java.sql.SQLException - if an error occurredPreparedStatement.executeUpdate()
public void close()
throws java.sql.SQLException
java.sql.SQLException - if an error occurredStatement.close()
public void addBatch()
throws java.sql.SQLException
java.sql.SQLException - if something went wrong
public int[] executeBatch()
throws java.sql.SQLException
Statement.executeBatch() for details.
java.sql.SQLException - if something went wrong
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||