Re: [Squirrel-sql-develop] Extending the base tab class does not run the SQL in the createStatement
A Java SQL client for any JDBC compliant database
Brought to you by:
colbell,
gerdwagner
From: Adam W. <win...@gm...> - 2011-03-13 04:24:15
|
Rob, I had the DatabaseObjectType wrong. I got it working now. Thanks, Adam On Sat, Mar 12, 2011 at 4:54 PM, Robert Manning <rob...@gm...>wrote: > Adam, > > One guess would be that the type used to add the details tab doesn't match > the one being returned by the object in the tree. You could set a > breakpoint in ObjectTreePanel.getTabbedPane(DatabaseObjectType) to see what > DatabaseObjectType is being used to get the tabbed pane that is displayed > on the right when you click an object in the tree. It must be the same as > the one you used to register the details tab with the ObjectTree for your > details tab to be displayed and populated. > > > Rob > > On Fri, Mar 11, 2011 at 1:58 PM, Adam Winn <win...@gm...> wrote: > >> I was looking at the Netezza External Table plugin and trying to mimic it >> for another DB type. I can display the external tables just fine by >> using objTree.addExpander(), but I can't get any details to appear when I >> click on the external tables or expand the arrow beside them. I'm also >> using objTree.addDetailTab(). In my details java file, it enters the >> method ExternalTableDetailsTab() but it never goes inside >> createStatement(). >> Does anyone know why this is? I read in the docs that when you extend >> the >> base tab class, it will run the SQL you have in the createStatement() >> method, but that is not happening for me. It isn't even entering that >> method for me. I'm assuming this worked fine in the Netezza External >> Table >> plugin and I'm essentially doing what it's doing but it never >> enters createStatement() and I don't get any details of the external >> table. >> >> The docs say: >> A source tab can then be implemented by extending the classes >> BaseSourceTab< >> https://sourceforge.net/apps/trac/squirrel-sql/browser/trunk/sql12/app/src/main/java/net/sourceforge/squirrel_sql/client/session/mainpanel/objecttree/tabs/BaseSourceTab.java >> > >> and BaseSourcePanel< >> https://sourceforge.net/apps/trac/squirrel-sql/browser/trunk/sql12/app/src/main/java/net/sourceforge/squirrel_sql/client/session/mainpanel/objecttree/tabs/BaseSourcePanel.java >> >. >> In particular, BaseSourceTab has an abstract method called createStatement >> which is implemented to return a PreparedStatement by using >> BaseObjectTab.getSession() and BaseObjectTab.getDatabaseObjectInfo(). The >> method getDatabaseObjectInfo returns the node that is selected from which >> can be found the name, schema and catalog of the object to write an SQL >> statement that queries the data dictionary for the source for that object. >> The BaseSourcePanel load method is then called with the ResultSet obtained >> by executing the PreparedStatement. >> >> Does anyone know why it's not entering the createStatement() method and >> therefore not showing me the details of the external table? >> >> Thanks, >> Adam >> >> ------------------------------------------------------------------------------ >> Colocation vs. Managed Hosting >> A question and answer guide to determining the best fit >> for your organization - today and in the future. >> http://p.sf.net/sfu/internap-sfd2d >> _______________________________________________ >> Squirrel-sql-develop mailing list >> Squ...@li... >> https://lists.sourceforge.net/lists/listinfo/squirrel-sql-develop >> > > |