Useful parameter for Quantum DB Eclipse plugin
In which Quantum DB is persuaded to play nicely with WordPress tables
Quantum DB is a very useful plugin for Eclipse (or Aptana Studio, which is what I use) which allows you to view and manipulate databases. Having this built in to the IDE obviates the need to have yet another application cluttering your development desktop.
To get it to work with the MySql databases most commonly used in PHP development you just need to download the MySql driver, unpack it and pop it into a suitable directory. Then, each time you create a new connection, you specify this driver as the one to use.
I came across one problem, though, which was stumping me for a while and needed a bit of web research to solve. WordPress often puts the default value ’0000-00-00 00:00:00′ in one or other of the post_date, post_date_gmt, post_modified or post_modified_gmt columns of the wp_posts table. Because Eclipse and the Quantum DB pluigin are Java based and Java can’t convert that value to a timestamp an error is returned and the table can’t be displayed.
The solution is simple, once you find it. All you need to do is add a directive to the database URL in the connection’s properties, so that
jdbc:mysql://<database url>:3306/<database name>
becomes
jdbc:mysql://<database url>:3306/<database name>?zeroDateTimeBehavior=convertToNull
This, as its wording implies, simply talls Quantum to convert the troublesome value to NULL when displaying so the error doesn’t arise and you can tinker with your tables to your heart’s content.