Java JDBC MySQL Connection getConnection()

Here you can find the source of getConnection()

Description

get Connection

License

Open Source License

Declaration

public static Connection getConnection() throws ClassNotFoundException, 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 Connection con;

    public static Connection getConnection() throws ClassNotFoundException, SQLException {
        //String url = "jdbc:mysql://node81165-vegaservices.jelasticlw.com.br/vegadb";        
        String url = "jdbc:mysql://179.188.16.53/atitudeambient2";
        Class.forName("com.mysql.jdbc.Driver");
        //con = DriverManager.getConnection (url,"vegadb","8cDxrFH7VB3B7GGs");
        con = DriverManager.getConnection(url, "atitudeambient2", "aadvmexico2355");
        return con;
    }//from   w ww.  j  a v a  2 s .c o m
}

Related

  1. deleteTableData(String tableName)
  2. getAllNames()
  3. getConnection()
  4. getConnection()
  5. getConnection()
  6. getConnection()
  7. getConnection()
  8. getConnection()
  9. getConnection()