Use JDatabase in model