Here you can find the source of getConnetion(String url, String username, String password)
public static Connection getConnetion(String url, String username, String password)
//package com.java2s; //License from project: Apache License import java.sql.*; public class Main { public static Connection getConnetion(String url, String username, String password) { final String driverName = "com.mysql.jdbc.Driver"; Connection connection = null; try {//from w ww.java 2s . c o m Class.forName(driverName); connection = DriverManager.getConnection(url, username, password); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (SQLException e) { e.printStackTrace(); } return connection; } }