I\'ve written a factory to produce java.sql.Connection objects:
java.sql.Connection
public class MySQLDatabaseConnectionFactory implements DatabaseConnectionFactory
To mock static method you should use a Powermock look at: https://github.com/powermock/powermock/wiki/MockStatic. Mockito doesn't provide this functionality.
You can read nice a article about mockito: http://refcardz.dzone.com/refcardz/mockito