代码拉取完成,页面将自动刷新
package com.dhxy.dao;
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.ArrayList;
import java.util.List;
import com.dhxy.entity.Admin;
/**
* 管理员
* @author Administrator
*
*/
public class AdminDao extends DataBaseDao {
public List<Admin> chaoxun() throws ClassNotFoundException, SQLException {
load();
List<Admin> arrayList = new ArrayList();
ResultSet rs = stmt.executeQuery("SELECT * FROM Admin;");// mysql语句
Admin admin = null;
while (rs.next()) {
admin = new Admin();
admin.setAnumber(rs.getInt("anumber"));
admin.setAname(rs.getString("aname"));
admin.setApassword(rs.getString("apassword"));
admin.setAphontnumber(rs.getInt("aphontnumber"));
arrayList.add(admin);
}
closeAll();
return arrayList;
}
public int tj(Admin admin) throws ClassNotFoundException, SQLException {
String aname = admin.getAname();
String apassword = admin.getApassword();
int aphonenumber = admin.getAphontnumber();
String str = "INSERT INTO Admin(aname,apassword,aphonenumber) VALUES(?,?,?);";
return super.addAll(str, aname, apassword, aphonenumber);
}
public void sc() throws ClassNotFoundException, SQLException {
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。