package com.hrtc23.util;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.Properties;
/**
*
* 操作数据库的基本类:其中三个属性提供了两个通用的方法,一个是获取连接的方法,一个是关闭资源的方法。
*
*/
public class BaseDao {
//1.三个属性
protected InputStream inputStream=null;
protected Connection ct=null;
protected PreparedStatement pst=null;
protected ResultSet rs=null;
//2.获取连接的方法
protected void getConnection(){
try {
//通过类加载器加载了db.properties
inputStream=this.getClass().getClassLoader().getResourceAsStream("db.properties");
//通过properties类来读取db.properties中的每一个连接数据库的参数
Properties pt=new Properties();