封装工具类
import java.io.IOException;
import java.io.InputStream;
import java.sql.*;
import java.util.Properties;
import com.mysql.jdbc.Connection;
public class JdbcUtils {
private static String driver = null;
private static String url = null;
private static String username = null;
private static String password = null;
static {
try {
InputStream In = JdbcUtils.class.getClassLoader().getResourceAsStream("db.properties");
Properties properties = new Properties();
properties.load(In);
driver = properties.getProperty("driver");
url = properties.getProperty(