java类库详细讲解
源代码在线查看: insertobjectoracle.html
Inserting an OBJECT Value into an Oracle Table
(Java Developers Almanac Example)
BODY CODE {font-family: Courier, Monospace; font-size: 11pt} TABLE, BODY {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt} PRE {font-family: Courier, Monospace; font-size: 10pt} H3 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11pt} A.eglink {text-decoration: none} A:hover.eglink {text-decoration: underline} -->
The Java Developers Almanac 1.4
Order this book from Amazon.
Home
>
List of Packages
>
java.sql
[73 examples]
>
Oracle OBJECTs
[5 examples]
e297.
Inserting an OBJECT Value into an Oracle Table
This example inserts a row into a table with a column that contains an
OBJECT type. The example uses the table and types created in
e296 Creating an OBJECT Type in an Oracle Database.
try {
// Create a statement
Statement stmt = connection.createStatement();
// Insert a row with values for both the object1 and object2 types
stmt.execute("INSERT INTO object1_table VALUES(1, object1('str1', object2('obj2str1', 123)))");
} catch (SQLException e) {
}
Related Examples
e296.
Creating an OBJECT Type in an Oracle Database
e298.
Inserting an OBJECT Value into an Oracle Table Using a Prepared Statement
e299.
Getting an OBJECT Value from an Oracle Table
e300.
Deleting an OBJECT Type from an Oracle Table
See also:
Batching
Connections
Database Meta Data
Deleting Data
Drivers
Importing and Exporting
Inserting and Updating Data
Oracle VARRAYs
Procedures and Functions
Retrieving Data
Scrollable Result Sets
Tables
Updatable Result Sets
© 2002 Addison-Wesley.