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

org.javaweb.jdbc.SqlConnection Maven / Gradle / Ivy

There is a newer version: 2.0.3
Show newest version
package org.javaweb.jdbc;

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

public class SqlConnection {

	/**
	 * 获取数据库链接
	 *
	 * @param className
	 * @param url
	 * @param username
	 * @param password
	 * @return
	 * @throws ClassNotFoundException
	 * @throws SQLException
	 */
	public static Connection getSqlConnection(
			String className, String url, String username, String password)
			throws ClassNotFoundException, SQLException {

		Class.forName(className);
		return DriverManager.getConnection(url, username, password);
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy