I\'ve written a factory to produce java.sql.Connection objects:
java.sql.Connection
public class MySQLDatabaseConnectionFactory implements DatabaseConnectionFactory
As mentioned before you can not mock static methods with mockito.
If changing your testing framework is not an option you can do the following:
Create an interface for DriverManager, mock this interface, inject it via some kind of dependency injection and verify on that mock.