Here you can find the source of getConnection()
public static Connection getConnection() throws ClassNotFoundException, SQLException
//package com.java2s; //License from project: Open Source License import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class Main { private static Connection con; public static Connection getConnection() throws ClassNotFoundException, SQLException { //String url = "jdbc:mysql://node81165-vegaservices.jelasticlw.com.br/vegadb"; String url = "jdbc:mysql://179.188.16.53/atitudeambient2"; Class.forName("com.mysql.jdbc.Driver"); //con = DriverManager.getConnection (url,"vegadb","8cDxrFH7VB3B7GGs"); con = DriverManager.getConnection(url, "atitudeambient2", "aadvmexico2355"); return con; }//from w ww. j a v a 2 s .c o m }