Re: [Qform-general] Using derby driver does not show any tables in the QueryForm
Brought to you by:
dglasser
From: Susan C. <hom...@ya...> - 2005-06-06 17:31:11
|
Hi Dave, Thanks a lot! I am using your new qform.jar file and it works great. The DDL tab in the Table Metatdata tab is nice too. Is there any chance in the future you'll add the functionality to the tool of being able to execute DDL? Regards, Susan Dave Glasser <dgl...@po...> wrote: On Fri, 3 Jun 2005 15:08:45 -0700 (PDT), Susan Cline wrote: >Hi, > >I just downloaded QueryForm today and I'm trying to use it with the Derby embedded >and client drivers. I'm successfully making a connection, but when I try to use the QueryForm, >New Query Form menu item I don't see any tables listed. The Table Owner shows the value >, and no other schemas are in the drop down. > >In Derby the default schema is APP which does not contain any tables, but can you use >the tool to create a new table in the default schema? > >Even if I connect to the derby database as user 'SYS', which exists as a schema within >Derby, I can not see anything in the Query Form other than . > >Any thoughts on why this is happening? QueryForm reads the list of tables from the database with this call: ResultSet rs = dbmd.getTables(null, null, "%", new String[] {"VIEW", "TABLE"}); The {"VIEW", "TABLE"} array is supposed to filter out things like system tables, temp tables, etc. When you create a new database in Derby, all of its system tables have type "SYSTEM TABLE". (It's actually more JDBC compliant in that regard than most commercial databases.) That's why they don't show up in QueryForm's list of tables. And any schemas for which no tables are returned by the getTables() call won't show up at all in the list in the dialog, since everything comes from the getTables() call. The is actually intended for databases where the table schema is always null or "". (Access is the only example that comes to mind at the moment.) So, when QueryForm gets back zero tables, it displays with an empty list of tables. I guess I could call DatabaseMetaData.getSchemas() to get the schemas without tables, just so they'll show up in the list. I'll send you a qform.jar off-list with this code: ResultSet rs = dbmd.getTables(null, null, "%", null); Overwrite your current qform.jar, and it should show you all of the system tables in the SYS and SYSIBM schemas. The APP schema won't show up until there's actualy tables in it. That code will also contain everything slated for the next release, which hopefully I'll get around to doing this weekend. BTW, there's no way to create tables with QueryForm. But one thing you might find handy in the code I'm going to send you (which is not in the current release) is a DDL tab on the table metadata window, which shows a basic CREATE TABLE statement for a particular table. It's handy if you want to replicate a table from one database to another but the DDL isn't available. ------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput a projector? How fast can you ride your desk chair down the office luge track? If you want to score the big prize, get to know the little guy. Play to win an NEC 61" plasma display: http://www.necitguy.com/?r _______________________________________________ Qform-general mailing list Qfo...@li... https://lists.sourceforge.net/lists/listinfo/qform-general |