Here you can find the source of getConnection()
public static Connection getConnection()
//package com.java2s; /* This file is part of the USIP Open Simulation Platform.<br> * * The USIP Open Simulation Platform is free software; you can * redistribute it and/or modify it under the terms of the new BSD Style * license associated with this distribution.<br> * * The USIP Open Simulation Platform is distributed WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. <BR> * *///w w w . j a v a 2s . c o m import java.sql.*; public class Main { private static String conn_string; /** * Returns a database connection. * * @return */ public static Connection getConnection() { Connection connection = null; try { Class.forName("org.gjt.mm.mysql.Driver").newInstance(); //$NON-NLS-1$ connection = DriverManager.getConnection(conn_string); return connection; } catch (Exception e) { e.printStackTrace(); } return null; } }