Java JDBC Connection Create getConnection()

Here you can find the source of getConnection()

Description

get Connection

License

Open Source License

Declaration

public static Connection getConnection() throws SQLException 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Properties;

public class Main {
    private static Properties props = null;

    public static Connection getConnection() throws SQLException {
        return DriverManager.getConnection(props.getProperty("url"), props.getProperty("username"),
                props.getProperty("password"));
    }/*from ww w.  ja v a  2  s  .c o  m*/
}

Related

  1. getConnection()
  2. getConnection()
  3. getConnection()
  4. getConnection()
  5. getConnection()
  6. getConnection(@Nonnull String connectUrl)
  7. getConnection(final String driver, final String url)
  8. getConnection(final String driverName, final String driverUrl, final String userName, final String password)
  9. getConnection(final String url)