How do you debug the JBW2 database?
|
|
Hi Morgan, I’ve thoroughly confused myself because I forgot that you’d implemented a database backend for JBW2. Consequently my naive attempts at moving files in and out of ~/.jbidwatcher is having no effect on the auctions being tracked! How do you debug the MySQL database component? This is an even more optimistic question: is the schema documented anywhere? :) Thanks. |
|
|
Greetings, I think I designed it right, so I could (although I haven’t tried yet) merge all the changes into the Theoretically I could allow users to edit the jdbc string, and connect to a different database. I haven’t tried that either, and I imagine I’m using some Derby-specific database types or something… I’m pretty sure there’s an interactive-mode Derby, similar to the MySQL client, that can connect to the database and you can run queries against it. I actually did some cool stuff with building a JRails (JRuby on Rails) app which talked to the JBidwatcher DB using the JDBC Active Record adapter, and was a pretty good way to walk through the data. Mostly, though, if I really need to debug the data in the database, I run it under my debugger, and issue calls against the running code. :) The Scripting window is another way to do similar things, although neither method is nearly as nice as the MySQL interactive client… — Morgan Schweers, CyberFOX! |
|
|
Greetings, Download the Derby binary ( http://db.apache.org/derby/releases/release-10…. ) and uncompress it. Now run ‘ij’ in Derby’s bin directory. On a Windows box, I run it like so: You’ll want to replace ’/mrs/’ with your own directory. I’m at work, so I can’t double-check, but on Mac OS X, you would go something like (presuming you uncompressed derby in the ~/oss directory):
From there you can issue SQL statements against the database, such as: The schema name is ‘user1’, so all the tables are prefixed with that. (I.e. user1.auctions, user1.entries, etc…) The above query shows that 370 auctions were saved, but JBidwatcher expected there to be 382, so 12 auctions got lost somehow. I still haven’t figured out how. :( — Morgan Schweers, CyberFOX! p.s. Note that because it’s an embedded database, you can’t be running ‘ij’ and JBidwatcher at the same time, only one can access the database at a time. |