|
2004.04.29 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--com.jdc.lang.Object
|
+--com.jdc.rdb.sql.SQL
|
+--com.jdc.rdb.sql.dml.DML
|
+--com.jdc.rdb.sql.dml.insert.Insert
Insert represents a Data Manipulation Language Insert
SQL statement. The Insert statement inserts
a row into a database Table or View. Inserting
a row into a View also inserts the row into the Table
on which the View is based.
SQL statements. It is an executable statement
that can be dynamically prepared.INSERT privilege on the table or view where a row is to be inserted.CONTROL privilege on the table or view where a row is to be inserted.SYSADM or DBADM authority.
Insert insert = new Insert(table);
insert.setValue(column 1 , true ); // boolean Column
insert.setValue(column 2 , 123 ); // int Column
insert.setValue(column 3 , "String" ); // String Column
insert.setValue(column 4 , new Date()); // Date Column
. . .
InsertStatus status = insert.execute();
if (status.isSuccessful())
{
// Insert success
}
else
{
// Insert failed!
}Insert into a View is not currently supported.
Into,
Columns,
Values,
With,
Serialized Form| Field Summary | |
static String |
COMMAND
The Insert statement command keyword. |
| Fields inherited from class com.jdc.rdb.sql.dml.DML |
sql |
| Fields inherited from class com.jdc.lang.Object |
string |
| Constructor Summary | |
Insert()
Constructs a new Insert statement object. |
|
Insert(String statement)
Constructs a new Insert statement object for the specified
Insert statement. |
|
Insert(Table table)
Constructs a new Insert statement object for the specified
Database Table. |
|
| Method Summary | |
InsertStatus |
execute()
Executes the Insert statement and returns
an InsertStatus object. |
Columns |
getColumns()
Returns the Columns clause for this
Insert statement. |
Into |
getInto()
Returns the Into clause for this
Insert statement. |
Values |
getValues()
Returns the Values clause for this
Insert statement. |
protected boolean |
isValid()
Returns true if the Insert statement is valid. |
Insert |
set(InsertClause clause)
Sets an InsertClause for this Insert
statement. |
Insert |
setValue(Column column,
boolean value)
Sets a boolean value for the specified Column. |
Insert |
setValue(Column column,
int value)
Sets an int value for the specified Column. |
Insert |
setValue(Column column,
Object value)
Sets an Object value for the specified Column. |
| Methods inherited from class com.jdc.rdb.sql.dml.DML |
finalize, getColumn, getConnection, getTable, setTable |
| Methods inherited from class com.jdc.rdb.sql.SQL |
addClause, execute, getClause, getCommand, getStatement, setCommand, setConnection, setStatement, toString |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final String COMMAND
Insert statement command keyword.
| Constructor Detail |
public Insert()
Insert statement object.
public Insert(Table table)
Insert statement object for the specified
Database Table.
SQLInvalidException - No table definition is specified.public Insert(String statement)
Insert statement object for the specified
Insert statement.
SQLInvalidException - No INSERT statement is specified.| Method Detail |
public InsertStatus execute()
Insert statement and returns
an InsertStatus object.
Insert statement status.public Columns getColumns()
Columns clause for this
Insert statement.
Insert statement Columns clause.public Into getInto()
Into clause for this
Insert statement.
Insert statement Into clause.public Values getValues()
Values clause for this
Insert statement.
Insert statement Values clause.protected boolean isValid()
true if the Insert statement is valid.
isValid in class SQLtrue.public Insert set(InsertClause clause)
InsertClause for this Insert
statement. Use this method to specify a custom Insert clause.
Insert statement object.
SQLInvalidException - No INSERT statement clause is specified.
public Insert setValue(Column column,
boolean value)
boolean value for the specified Column.
The Column alias is used to create the Columns
clause and the boolean value is used to create the Values
clause for this Insert statement.
Insert statement object.
SQLInvalidException - No column is specified, an invalid
column is specified, or a column for which a value has
already been set is specified.
public Insert setValue(Column column,
int value)
int value for the specified Column.
The Column alias is used to create the Columns
clause and the int value is used to create the Values
clause for this Insert statement.
Insert statement object.
SQLInvalidException - No column is specified, an invalid
column is specified, or a column for which a value has
already been set is specified.
public Insert setValue(Column column,
Object value)
Object value for the specified Column.
The Column alias is used to create the Columns
clause and the Object value is used to create the Values
clause for this Insert statement.
Insert statement object.
SQLInvalidException - No column is specified, an invalid
column is specified, or a column for which a value has
already been set is specified.
|
2004.04.29 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||