6.12-PrepareStatement,JdbcUtil 读取数据库配置文件properties,dao模式

一、PrepareStatement
        防止sql注入
        PrepareStatement 是预编译sql语句
        更加灵活,更有效率
    executeUpdate() 做增删改
    executeQuery()   查询
    ? 占位符
    从1开始计数
二、*JdbcUtil 读取数据库配置文件properties
    抽取工具类JdbcUtil
        获取连接
        释放资源
    读取配置文件:
        类加载器读取配置文件
            驱动信息,url,用户名,密码
        ResourceBundle
        
三、dao模式
    entity,bean,pojo,domain
    dao      数据操作层
    daoImpl
    service  业务层
    serviceImpl
    test     测试层(junit4单元测试)
    持久化:
        将程序中的数据在瞬时状态和
        持久状态间转换的机制即为数据持久化
    使用面向接口编程降低代码之间的耦合性
    
    
    
    
    


四、C3p0连接池配置
    
    
    
    
    
    
    
志存高远,脚踏实地!
原文地址:https://www.cnblogs.com/benben2013A/p/7083429.html