getElementTypeName

Description

Returns the name of the type in the COLLECTION elements. If a domain of the columnIndex-th attribute is not COLLECTION such as SET, MULTISET, or SEQUENCE, SQLException occurs in the end.

Syntax

String getElementTypeName(int columnIndex)

Return Value
Example

// The following schema is used in this example.

//

// create class foo(

//    a  set(int),

//    b  multiset(int),

//    c  sequence(int)

// );

 

String sql = "select * from foo" ;

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

 

Statement stmt = con.createStatement();

 

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

CUBRIDResultSetMetaData rsmd = (CUBRIDResultSetMetaData)

                               rs.getMetaData();

 

int numberofColumn = rsmd.getColumnCount();

for (int i=1; i <= numberofColumn; i++ ) {

   System.out.println(rsmd.getElementType(i) );

   System.out.println(rsmd.getElementTypeName(i) );

}