Java JDBC MySQL Connection getDBConn()

Here you can find the source of getDBConn()

Description

get DB Conn

License

Open Source License

Declaration

public static Connection getDBConn() 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;

public class Main {
    private static String DBURL = "jdbc:mysql://localhost:3306/nearby";
    private static String USERNAME = "root";
    private static String PASSWORD = "root";

    public static Connection getDBConn() throws SQLException {
        return DriverManager.getConnection(DBURL, USERNAME, PASSWORD);
    }//w  w  w  . j a  v  a  2  s  .  c o m
}

Related

  1. getConnection(String dbUrl, String dbName, String userName, String password)
  2. getConnection(String ip, String dataBaseName, String password, String username)
  3. getConnection(String ip, String db, String user, String passWord)
  4. getConnetion(String url, String username, String password)
  5. getcount()
  6. getDbConnection()
  7. getDBConnection()
  8. getDBConnection(String database)
  9. getDBConnection(String dbServer, String dbName, String dbUser, String dbPass)