Java JDBC Connection Create getConnection(String drvr, String url, String nm, String pass)

Here you can find the source of getConnection(String drvr, String url, String nm, String pass)

Description

get Connection

License

Apache License

Declaration

public static Connection getConnection(String drvr, String url, String nm, String pass) throws Exception 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.sql.Connection;
import java.sql.DriverManager;

public class Main {
    public static Connection getConnection(String drvr, String url, String nm, String pass) throws Exception {
        Class.forName(drvr);//from w  w  w.  j a  va 2s  .  c  o m
        return DriverManager.getConnection(url, nm, pass);

    }
}

Related

  1. getConnection(String driver, String connectString)
  2. getConnection(String driver, String url, String user, String pass)
  3. getConnection(String driver, String url, String username, String password)
  4. getConnection(String driverClass, String url, String user, String password)
  5. getConnection(String driverName, String urlprefix, String host, String port, String database, String user, String password)
  6. getConnection(String filename)
  7. getConnection(String jdbcDriverName, String connectionURL)
  8. getConnection(String propertiesFilePath)
  9. getConnection(String subprotocol, String subname, String user, String password)