Posts

Showing posts with the label jdbc

Can I keep one jdbc connection for the whole time [duplicate]

Can I keep one jdbc connection for the whole time [duplicate] This question already has an answer here: My Java App has a lot of queries ( ~1000 queries/each button). Can I open JDBC connection when my app is launched and keep it instead of opening a connection every single time the button pressed and closing it after 1k queries? I understand that it is possible, but would it be better or no? Can it be lost somehow? I use free mysql hosting that's why every time I open/close a new one it takes a lot of time. This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question. You might find a little bit of useful information in stackoverflow.com/q/7280825/924 the general advice seems to be to use a Connection Pool instead of a single connection. – Brandon Haugen Jul 1 at 23:38 ...