Reputation: 2424
Im in the process of developing a fairly simple yet large scale (in terms of potential Database size) Java application.
My question is what is the best way to maintain a connection to a MYSQL database? I will be needing to update it every few seconds, but want to do this safely and properly.
Tips, suggestions, should i not use SQL? If not, then what are some other database options, simple booleans and strings are needed to be stored.
Thank you.
EDIT:
To anyone who is interested or comes across this question, i've found this example of connection pooling thanks to Nambari's answer:
http://www.javatips.net/blog/2013/12/dbcp-connection-pooling-example
Upvotes: 1
Views: 176
Reputation: 66637
One of the solutions for your problem would be using connection pool. This way you can re-use connections instead of creating everytime.
Apache DBCP is one of the highly used API for this scenario.
Upvotes: 4