All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.datastax.util.db.ConnUtil Maven / Gradle / Ivy

package com.datastax.util.db;

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

/**
 * UserItem: Anders Hong
 * Date: 6/14/13
 * Time: 3:35 PM
 */
public class ConnUtil {
    public static Connection createConnection(String driverClassName,String url,String user,String password) {
        Connection conn = null;
        try {
            Class.forName(driverClassName);
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
        try {
            conn = DriverManager.getConnection(url, user, password);
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return conn;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy