1 19 20 package org.netbeans.modules.db.explorer.infos; 21 22 import java.sql.ResultSet ; 23 import java.util.HashMap ; 24 import java.util.Vector ; 25 import org.netbeans.api.db.explorer.DatabaseException; 26 import org.netbeans.lib.ddl.impl.DriverSpecification; 27 import org.netbeans.modules.db.explorer.nodes.DatabaseNode; 28 29 public class RefTableListNodeInfo extends DatabaseNodeInfo { 30 static final long serialVersionUID =318942800614012305L; 31 32 public void initChildren(Vector children) throws DatabaseException { 33 try { 34 String table = (String )get(DatabaseNode.TABLE); 35 36 DriverSpecification drvSpec = getDriverSpecification(); 37 drvSpec.getExportedKeys(table); 38 ResultSet rs = drvSpec.getResultSet(); 39 if (rs != null) { 40 HashMap rset = new HashMap (); 41 DatabaseNodeInfo info; 42 while (rs.next()) { 43 rset = drvSpec.getRow(); 44 info = DatabaseNodeInfo.createNodeInfo(this, DatabaseNode.EXPORTED_KEY, rset); 45 rset.clear(); 46 if (info != null) 47 children.add(info); 48 else 49 throw new Exception (bundle().getString("EXC_UnableToCreateExportedKeyNodeInfo")); 50 } 51 rs.close(); 52 } 53 } catch (Exception e) { 54 throw new DatabaseException(e.getMessage()); 55 } 56 } 57 } 58 | Popular Tags |