I wrote a new JDBC driver which I'm testing with execute query, and I ran into a problem with the tree viewer

65 views
Skip to first unread message

Steve Lowenthal

unread,
Mar 12, 2014, 8:15:42 PM3/12/14
to execut...@googlegroups.com
Hi,

I love your software, and in is very full featured.  I'm working on a new JDBC driver, and I am stumped by a glitch in the tree view.  Execute query correctly displays all of the schema, but is calling getTables with a null schema.  As a result, my driver returns the tables for the default schema.  Is it possible I've missed returning an important value for one of the MetaData calls.  Any pointers in the right direction would really help.

Also, as I navigate deeper into the tree, I get the folliowing NPE:  I wonder if it's somehow related to the first problem.  I think I have a crashed thead, but can still see the correct columns. getColumns is called with the correct schema pattern and table pattern.

Steve. 

Steve Lowenthal

unread,
Mar 12, 2014, 8:18:51 PM3/12/14
to execut...@googlegroups.com
Oh - also I do know for the NPE, in this method:

liquibase.database.Database createDatabase:,  the variable databaseName is null. 

Takis Diakoumis

unread,
Mar 12, 2014, 9:42:35 PM3/12/14
to execut...@googlegroups.com
hello

thanks for this :)

the database name is used as retrieved from the MetaData method getDatabaseProductName

in any case, i will modify the code to handle a null database name value as i should have in the first place.

i will also have a look at the browser tree where getTables is called with a null schema (sounds like really old code i missed).

i'll get back to you asap.

thanks again :)
Takis








--
You received this message because you are subscribed to the Google Groups "Execute Query" group.
To unsubscribe from this group and stop receiving emails from it, send an email to executequery...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
http://executequery.org

Steve Lowenthal

unread,
Mar 13, 2014, 1:43:41 PM3/13/14
to execut...@googlegroups.com
Takis,

Thanks for your quick reply.  We actually have a database product name, and have implemented the method. For some reason, it looks like that API wasn't called.  I'm wondering if something we did may have caused that.  I'll double check tho.

Steve.

Steve Lowenthal

unread,
Mar 13, 2014, 2:21:40 PM3/13/14
to execut...@googlegroups.com

This "photo" may be a clue.  It looks like you're introspecting the DatabaseMetaData class, and it looks like you only find "toString" and HashValue.  It doesn't look like we're picking up all of the other properties. 

Takis Diakoumis

unread,
Mar 13, 2014, 4:44:34 PM3/13/14
to execut...@googlegroups.com
hello

as you've already picked up, the database properties are retrieved by reflection from the DatabaseMetaData class for the connection. i then simply query those methods whose return type is a primitive or a string - which is all the ones i'm interested in for that panel. you can see the source for this in the DefaultDatabaseHost class getDatabaseProperties method.

on the earlier possible null schema issue, the tree is populated using schema/catalog values as retrieved and would only be null where the connection has provided a null value. you can see this part in the getObjects method of DefaultDatabaseMetaTag.

hope this helps and let me know if i can help further...
keep me posted.

thanks :)
Takis




On Fri, Mar 14, 2014 at 5:21 AM, Steve Lowenthal <st...@datastax.com> wrote:

This "photo" may be a clue.  It looks like you're introspecting the DatabaseMetaData class, and it looks like you only find "toString" and HashValue.  It doesn't look like we're picking up all of the other properties. 

--
You received this message because you are subscribed to the Google Groups "Execute Query" group.
To unsubscribe from this group and stop receiving emails from it, send an email to executequery...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Steve Lowenthal

unread,
Mar 14, 2014, 11:54:36 AM3/14/14
to execut...@googlegroups.com
In short I have everything working.   The tree issue was caused by a metaData Setting - supportsSchemasInTableDefinitions.  It was false, but I should have set it to true.  The introspection problem is more interesting - All of the invokes returned IllegalAccessException because my implementation was not private.  I think if you called the methods on the interface, it may have worked instead of reflecting my implementation.  I changed my class to public, and it works.  

I didn't realize at first that your source tarball is downloadable, but now I have it.  

Also, when opening the database browser tree, at some point you do a count(*) on the table to determine the number of rows.  How exactly do you suppress that, as we may have rows in the billions.

Thanks again for your help.




On Wednesday, March 12, 2014 5:15:42 PM UTC-7, Steve Lowenthal wrote:

Takis Diakoumis

unread,
Mar 17, 2014, 4:48:01 PM3/17/14
to execut...@googlegroups.com
hello

glad you've got most of it working now...

the count can't be turned off - but i think i might add an option to do this now. it runs in a separate thread so technically shouldn't block - let me know if you are experiencing issues beyond just this panel when it executes.

source disclaimer - lots of code over a long period of time ;)

let me know if i can help anywhere else. 

thanks
Takis




--
You received this message because you are subscribed to the Google Groups "Execute Query" group.
To unsubscribe from this group and stop receiving emails from it, send an email to executequery...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages