Reading the database is generally the wrong way to do things in JIRA, but...
The empty result could be a genuine case of "no custom fields defined yet" - won't be true if you have Software or Service Desk, but if it's a plain Core install, it could be. What does the GUI say is there?
If there are fields in there, then it's the connection - it's either not running the query at all, or it's unable to connect. You'll need to check the login parameters etc.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.