addToSet

Description

Inserts the value specified in value into the attribute named attrName and associated with SET or MULTISET constraints on the CUBRIDOID instance.

Syntax

void addToSet(String attrName, Object value)

Example

//create class foo(a set of int, b multiset of int )

//insert into foo values({1},{2})

String sql = "select foo from foo" ;

 

Connection con = DriverManager.getConnection(url,user,passwd);

 

Statement stmt = con.createStatement();

CUBRIDResultSet rs = (CUBRIDResultSet)stmt.executeQuery(sql);

while (rs.next ()) {

   CUBRIDOID oid = rs.getOID(1);        // get OID

   oid.addToSet("a",new Integer(11));  // a : {1} -> {1,11}

   oid.addToSet("b",new Integer(13));  // b : {2} -> {2, 13}

}