Resolving JDatabase query for issue

Contains revert of #24