import java.sql.*;
class jdbcSelectCollection {
  public static void main (String args []) throws SQLException {
   Connection conn = getConn();
   Statement stmt = conn.createStatement();
   ResultSet rset =
     stmt.executeQuery("SELECT country, collect(organization)" +
           "FROM isMember GROUP BY country");
   if (rset!= null) return;
   ResultSetMetaData rsetmetadata = rset.getMetaData();
   int numCols = rsetmetadata.getColumnCount();
   while (rset.next()) {
    for(int i=1; i<=numCols; i++) {
     Object value = rset.getObject(i);
     if (rset.wasNull()) System.out.print("null  ");
     else if (value instanceof java.sql.Struct)
     { System.out.print("(" +
         ((java.sql.Struct)value).getSQLTypeName() + ": ");
       Object[] attributes =
         ((java.sql.Struct)value).getAttributes();
       // attributes
       for (int j = 0; j < attributes.length; j++)
            System.out.print(attributes[j] + "  ");
       System.out.print(")");
     }
     else System.out.print(value + "  "); }
    System.out.println();  }
   rset.close(); stmt.close(); conn.close();  }
 private static Connection getConn() throws SQLException
    {
   DriverManager.registerDriver(new
         oracle.jdbc.driver.OracleDriver());
   String url = "jdbc:oracle:thin:/*hier korrekt fortsetzen              */@//oracle11.informatik.uni-goettingen.de:1521/dbis";
   return DriverManager.getConnection(url,"scott","tiger");
 }}
