91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 1.43MB
    文件類(lèi)型: .zip
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2023-09-20
  • 語(yǔ)言: Java
  • 標(biāo)簽:

資源簡(jiǎn)介

簡(jiǎn)單jsp動(dòng)態(tài)頁(yè)面源代碼 實(shí)現(xiàn)頁(yè)面操作對(duì)數(shù)據(jù)庫(kù)的增刪改查 特別簡(jiǎn)單化,適合初學(xué)者查看!

資源截圖

代碼片段和文件信息

package?com.hr.dao;

import?java.io.File;
import?java.io.FileInputStream;
import?java.io.IOException;
import?java.sql.Connection;
import?java.sql.DriverManager;
import?java.sql.PreparedStatement;
import?java.sql.ResultSet;
import?java.sql.SQLException;
import?java.sql.Statement;
import?java.util.List;
import?java.util.Properties;

public?class?baseDao?{
String?driver;
String?url;
String?user;
String?password;
private?Connection?conn;
private?ResultSet?rs;
private?PreparedStatement?pst;
private?Statement?st;

public?baseDao()?{
super();
init();
}

public?void?init()?{
Properties?p?=?new?Properties();//??????????????????????
File?path=new?File(baseDao.class.getClassLoader().getResource(“/“).getFile()“dbConfig.properties“);
try?{
//????????????????????????????
FileInputStream?fis?=?new?FileInputStream(path);
p.load(fis);//????????
this.driver?=?p.getProperty(“driver“);//?????????????
this.url?=?p.getProperty(“url“);
this.user?=?p.getProperty(“user“);
this.password?=?p.getProperty(“password“);

}?catch?(IOException?e)?{
//?TODO?Auto-generated?catch?block
e.printStackTrace();
}

}

public?Connection?getConn()?{
try?{
Class.forName(driver);
this.conn?=?DriverManager.getConnection(url?user?password);
System.out.println(“數(shù)據(jù)庫(kù)連接成功“?+?this.conn.toString());

}?catch?(ClassNotFoundException?e)?{
//?TODO?Auto-generated?catch?block
System.out.println(“未找到驅(qū)動(dòng)“);
}?catch?(SQLException?e)?{
//?TODO?Auto-generated?catch?block
System.out.println(“SQL語(yǔ)句不正確!“);
e.printStackTrace();
}

return?this.conn;
}

public?ResultSet?getRs(String?sql)?{
if?(this.conn?==?null)?{
this.getConn();
}
try?{
st?=?conn.createStatement();
this.rs?=?st.executeQuery(sql);
}?catch?(SQLException?e)?{
//?TODO?Auto-generated?catch?block
e.printStackTrace();
}
return?this.rs;
}

public?int?getUpdate(String?sql)?{
if?(this.conn?==?null)?{
this.getConn();
}
int?result?=?0;
try?{
st?=?conn.createStatement();
result?=?st.executeUpdate(sql);
}?catch?(SQLException?e)?{
//?TODO?Auto-generated?catch?block
e.printStackTrace();
}
return?result;
}

public?ResultSet?getRs(String?sql?object[]?para)?{
if?(this.conn?==?null)?{
this.getConn();
}
try?{
pst?=?conn.prepareStatement(sql);
for?(int?i?=?0;?i? pst.setobject(i?+?1?para[i]);
}
this.rs?=?pst.executeQuery();
}?catch?(SQLException?e)?{
//?TODO?Auto-generated?catch?block
e.printStackTrace();
}
return?this.rs;
}

public?int?getUpdate(String?sql?object[]?para)?{
if?(this.conn?==?null)?{
this.getConn();
}
int?result?=?0;
try?{
pst?=?conn.prepareStatement(sql);
for?(int?i?=?0;?i? pst.setobject(i?+?1?para[i]);
}
result?=?pst.executeUpdate();
}?catch?(SQLException?e)?{
//?TODO

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2015-08-25?17:15??ServletTry\
?????文件?????????529??2015-08-24?09:11??ServletTry\.classpath
?????目錄???????????0??2015-08-25?17:16??ServletTry\.myeclipse\
?????文件?????????303??2015-08-24?09:11??ServletTry\.mymetadata
?????文件????????1753??2015-08-24?09:16??ServletTry\.project
?????目錄???????????0??2015-08-25?17:15??ServletTry\.settings\
?????文件?????????500??2015-08-24?09:11??ServletTry\.settings\.jsdtscope
?????文件??????????88??2015-08-24?09:11??ServletTry\.settings\org.eclipse.core.resources.prefs
?????文件?????????395??2015-08-24?09:11??ServletTry\.settings\org.eclipse.jdt.core.prefs
?????文件?????????468??2015-08-24?09:11??ServletTry\.settings\org.eclipse.wst.common.component
?????文件?????????252??2015-08-24?09:11??ServletTry\.settings\org.eclipse.wst.common.project.facet.core.xml
?????文件??????????49??2015-08-24?09:11??ServletTry\.settings\org.eclipse.wst.jsdt.ui.superType.container
?????文件???????????6??2015-08-24?09:11??ServletTry\.settings\org.eclipse.wst.jsdt.ui.superType.name
?????目錄???????????0??2015-08-25?17:15??ServletTry\WebRoot\
?????目錄???????????0??2015-08-25?17:15??ServletTry\WebRoot\meta-INF\
?????文件??????????36??2015-08-24?09:11??ServletTry\WebRoot\meta-INF\MANIFEST.MF
?????目錄???????????0??2015-08-25?17:15??ServletTry\WebRoot\WEB-INF\
?????目錄???????????0??2015-08-25?17:15??ServletTry\WebRoot\WEB-INF\classes\
?????目錄???????????0??2015-08-25?17:15??ServletTry\WebRoot\WEB-INF\classes\com\
?????目錄???????????0??2015-08-25?17:15??ServletTry\WebRoot\WEB-INF\classes\com\hr\
?????目錄???????????0??2015-08-25?17:15??ServletTry\WebRoot\WEB-INF\classes\com\hr\dao\
?????文件????????5589??2015-08-24?15:39??ServletTry\WebRoot\WEB-INF\classes\com\hr\dao\baseDao.class
?????文件????????1009??2015-08-24?09:15??ServletTry\WebRoot\WEB-INF\classes\com\hr\dao\CustomeDao.class
?????文件????????7196??2015-08-24?18:00??ServletTry\WebRoot\WEB-INF\classes\com\hr\dao\CustomeDaoImp.class
?????文件????????1154??2015-08-24?10:27??ServletTry\WebRoot\WEB-INF\classes\com\hr\dao\filter.class
?????目錄???????????0??2015-08-25?17:15??ServletTry\WebRoot\WEB-INF\classes\com\hr\entity\
?????文件????????3058??2015-08-24?09:15??ServletTry\WebRoot\WEB-INF\classes\com\hr\entity\Customes.class
?????目錄???????????0??2015-08-25?17:15??ServletTry\WebRoot\WEB-INF\classes\com\hr\myServlet\
?????文件????????7333??2015-08-25?09:15??ServletTry\WebRoot\WEB-INF\classes\com\hr\myServlet\UserServlet.class
?????文件????????3170??2015-08-24?09:15??ServletTry\WebRoot\WEB-INF\classes\com\hr\myServlet\UserServlet2.class
?????目錄???????????0??2015-08-25?17:15??ServletTry\WebRoot\WEB-INF\classes\com\hr\test\
............此處省略29個(gè)文件信息

評(píng)論

共有 條評(píng)論

相關(guān)資源