Use JDBC to connect to MySQL database. Template can be used for Oracle as well.