Here you can find the source of getConnection(String dbName)
public static Connection getConnection(String dbName)
//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 final String mdbDriver = "org.sqlite.JDBC"; private static final String mdbUrl = "jdbc:sqlite:"; private static final String mdbName = "GenericsDaoDB.db3"; private static final String mdbUser = ""; private static final String mdbPwd = ""; private static Connection mConn; public static Connection getConnection(String dbName) { if (mConn == null) { try { Class.forName(mdbDriver); String connDbName = mdbName; if (dbName != null) { connDbName = dbName; }//from w w w . j av a 2s . com mConn = DriverManager.getConnection(mdbUrl + connDbName, mdbUser, mdbPwd); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (SQLException e) { e.printStackTrace(); } } else { return mConn; } return mConn; } public static Connection getConnection() { return getConnection(null); } }