Java JDBC Connection Create getConnection(Properties pro)

Here you can find the source of getConnection(Properties pro)

Description

get Connection

License

Apache License

Declaration

public static Connection getConnection(Properties pro) throws Exception 

Method Source Code


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

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

import java.util.Properties;

public class Main {

    public static Connection getConnection(Properties pro) throws Exception {
        Class.forName(pro.getProperty("jdbc.driver"));
        return DriverManager.getConnection(pro.getProperty("jdbc.url"), pro.getProperty("jdbc.username"),
                pro.getProperty("jdbc.password"));
    }//from  www.  j av a  2  s .  co  m
}

Related

  1. getConnection(@Nonnull String connectUrl)
  2. getConnection(final String driver, final String url)
  3. getConnection(final String driverName, final String driverUrl, final String userName, final String password)
  4. getConnection(final String url)
  5. getConnection(final String url, final String username, final String password, final String driverClass)
  6. getConnection(Properties prop)
  7. getConnection(Properties properties)
  8. getConnection(String dbName)
  9. getConnection(String dbUrl, String dbUser, String dbPassword)