package org.dao;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

 

public class BaseDao {
	public static final String DRIVER="com.mysql.jdbc.Driver";
	public static final String URLSTR="jdbc:mysql://localhost/exam";
	public static final String UID="root";
	public static final String PWD="sa";
	
	public static final String TABLE_USER=" tenyears_users ";
	public static final String TABLE_TITLE=" tenyears_newstitle ";
	public static final String TABLE_CONTENT=" tenyears_newscontent ";
	public static final String TABLE_TYPE=" tenyears_newstype ";
	public static final Integer ROWS=10;
	
	protected  Connection con;
	protected PreparedStatement pst;
	protected ResultSet res;
	protected Integer pageCount;
	
	protected void open(){
		try {
			Class.forName(DRIVER);
			con=DriverManager.getConnection(URLSTR,UID,PWD);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	protected void close(){
		try {
			 if(res != null) res.close();
			 if(pst !=null) pst.close();
			 if(con !=null) con.close();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public Integer getPageCount() {
		return pageCount;
	}

	
	
}
最近下载更多
今晚都别睡啦  LV8 2022年5月20日
3199625134  LV10 2022年4月20日
wang123999  LV19 2021年6月13日
vaterz  LV25 2021年2月7日
wwyyxx  LV6 2019年12月30日
fangen0005  LV25 2019年12月12日
homeshow  LV18 2019年4月11日
养猪专业户  LV12 2019年3月4日
hdhbshs  LV16 2018年12月24日
两次零食  LV2 2018年11月5日
最近浏览更多
pangzhihui  LV12 2023年12月23日
xiongwei11231  LV8 2023年12月2日
uni-code_0123  LV1 2023年11月11日
a197304a 2023年1月8日
暂无贡献等级
Uu811y 2022年11月14日
暂无贡献等级
111114758  LV2 2022年10月31日
张好好  LV1 2022年10月26日
13112360  LV2 2022年9月27日
riverlover  LV1 2022年8月25日
zzzsy1  LV3 2022年7月28日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友