求java编程实验室管理系统代码public FoPage findAllOperationAgent(OperationAgentBaseEntity entity,
int pageNum, int pageSize){
logger.info("查找空余实验室");
FoHQLQuery query = new FoHQLQuery();
String hql = "fromOperationAgentBaseEntity a ";
//查询条件
String whereSql = " where 1=1 ";
//实验室名字或编号
if(entity.getAgentname()!=null!entity.getAgentname().trim().equals("")){
whereSql += " and a.agentname like :agentName";
query.setString("agentName", "%"+entity.getAgentname()+"%");
}
//显示条数
String countHql = "select count(*) " + hql+ whereSql;query.setHQL(hql + whereSql + " order by a.agentname ");
query.setCountHQL(countHql );
query.setPageNum(pageNum);
query.setpageSize(pageSize);
return this.execFoPageQuery(query);
}public String delOperationAgentEntity(final String[] agentCode){
logger.info("删除当前已使用实验室");
String message = "delError";
try
{
message = (String)this.getHibernateTemplate().execute(
new HibernateCallback() {
public Object doInHibernate(Session session) throws HibernateException {
Transaction tx = session.beginTransaction();
try {
for(int i=0;agentCode!=nulliagentCode.length;i++){
SQLQuery delAgentQuery = session.createSQLQuery("delete from operation_agent_base c where c.agentcode ='"+agentCode[i]+"'");
SQLQuery delTelQuery = session.createSQLQuery("delete from OPERATION_CUSTOMER_TELEPHONE c where c.customernum ='"+agentCode[i]+"'");
delAgentQuery.executeUpdate();
delTelQuery.executeUpdate();
}
tx.commit();
}catch(Exception e){
tx.rollback();
logger.error("删除\r\n"+e.toString());
e.printStackTrace();
throw new HibernateException(e);
}
return "delSuccess";
}
}
);
}catch(Exception e)
{
logger.error("删除\r\n"+e.toString());
message = "delError";
}
return message;
}
遇到相同的有提示就xietiaosql判断下 select count(*) from tbl where houseId = ? 如果返回值等于0 则无相同 反之则反
求Java编的登录界面代码:登录后分别进入管理员界面及用户界面 , 依据是数据库中的用户名和密码分三个包,自己建个包,导进去就ok了,数据库是access的 。
package 登录;
import java.awt.EventQueue;
public class Cilent {
private JFrame frame;
private JTextField textField;
private JPasswordField passwordField;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
Cilent window = new Cilent();
window.frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the application.
*/
public Cilent() {
initialize();
}
/**
* Initialize the contents of the frame.
*/
private void initialize() {
frame = new JFrame();
frame.setTitle("登陆界面");
frame.setBounds(100, 100, 450, 300);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(null);
frame.setResizable(false);
JLabel lblNewLabel = new JLabel("用户名");
lblNewLabel.setBounds(38, 43, 80, 34);
frame.getContentPane().add(lblNewLabel);
textField = new JTextField();
textField.setBounds(155, 42, 227, 37);
frame.getContentPane().add(textField);
textField.setColumns(10);
JLabel label = new JLabel("密 码");
label.setBounds(38, 115, 80, 34);
frame.getContentPane().add(label);
passwordField = new JPasswordField();
passwordField.setBounds(155, 115, 227, 37);
frame.getContentPane().add(passwordField);
推荐阅读
- 长沙直播设备购买,长沙直播设备购买公司
- 什么直播软件占用低些,什么直播不占内存
- html5文字轮滑显示,html文字轮播代码
- 690是什么cpu,690是什么意思
- 怎么看mysql表的约束 mysql查看表的约束信息
- python爬虫能兼职吗,学会python爬虫能做什么兼职
- mysql怎么安装服务端 mysql server安装教程55
- 关于java模拟队列代码实现的信息
- 城市竞速赛游戏,城市竞速赛车游戏