Inserting an OBJECT Value into an Oracle Table - Java JDBC

Java examples for JDBC:Oracle

Description

Inserting an OBJECT Value into an Oracle Table

Demo Code

import java.sql.Connection;
import java.sql.Statement;

public class Main {
  public static void main(String[] args) throws Exception {
    Connection connection = null;
    // 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)))");
  }//from   w w  w  .  java 2 s . c  o  m
}

Related Tutorials