I’m interested in developing a desktop application that connects to a MySQL DB.
After reading this java tutorial on DB connection (and several others) I have a question.
Using DataSource seems popular on J2EE while DriverManager is a common choise for desktop applications.
Is it still possible to use DataSource on a desktop application? If yes, is it a better choice over DriverManager?
I’m interested in developing a desktop application that connects to a MySQL DB. After
Share
It’s perfectly possible to use a DataSource on a desktop application.
Server apps are usually multi-thread, multi-user applications, where several connections to the database are open in parallel. A pooled DataSource is critical here.
Desktop apps are usually single-user applications, where you just need one connection to the database. So a pooled datasource isn’t necessary in this case.