#Java fx with mysql

5 messages · Page 1 of 1 (latest)

nimble fractal
#

I'm learning about connecting java fx with mysql and I found a good internet resource but I still have questions.
this is my folder structure following the mvc pattern. I created a util java class to handle my connection with the database that has the following methods. My question revolves around wether it's better to use the dbConnect once in the initialize method present in the controller rather opening and closing the connection with the databse each time a query is made, because I assume that's resource heavy.

nova yewBOT
#

This post has been reserved for your question.

Hey @nimble fractal! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

jagged heath
#

" each time a query is made," is bad idea because of the overhead. A good solutuion is to use Connection Pools

#

You use connection pool for reusable connections