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 ProcedureListNodeInfo extends DatabaseNodeInfo { 30 static final long serialVersionUID =-7911927402768472443L; 31 32 public void initChildren(Vector children) throws DatabaseException { 33 try { 34 DriverSpecification drvSpec = getDriverSpecification(); 35 drvSpec.getProcedures("%"); 36 ResultSet rs = drvSpec.getResultSet(); 37 if (rs != null) { 38 HashMap rset = new HashMap (); 39 DatabaseNodeInfo info; 40 while (rs.next()) { 41 rset = drvSpec.getRow(); 42 43 if (drvSpec.getDBName().indexOf("Oracle") != -1) { 45 String pac = (String ) rset.get(new Integer (1)); 46 if (pac != null) 47 rset.put(new Integer (3), pac + "." + rset.get(new Integer (3))); 48 } 49 50 info = DatabaseNodeInfo.createNodeInfo(this, DatabaseNode.PROCEDURE, rset); 51 if (info != null) { 52 info.put(DatabaseNode.PROCEDURE, info.getName()); 53 children.add(info); 54 } else 55 throw new Exception (bundle().getString("EXC_UnableToCreateProcedureNodeInfo")); rset.clear(); 57 } 58 rs.close(); 59 } 60 } catch (Exception e) { 61 DatabaseException dbe = new DatabaseException(e.getMessage()); 62 dbe.initCause(e); 63 throw dbe; 64 } 65 } 66 67 } 68 | Popular Tags |