⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 userinfodao.java

📁 中应用程序的访问权限对Java Web Console 中应用程序的访问权限 成功登录 Web 控制台后,可能无法自动访问在该控制台中注册的所有应用程序。通常,必须安装应用程序,才能让所有的用户在控制
💻 JAVA
字号:
package edu.yinhe.mis.model;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import com.mysql.jdbc.ResultSet;

import edu.yinhe.mis.dto.CardDTO;
import edu.yinhe.mis.dto.UserinfoDTO;
import edu.yinhe.system.model.BaseDAO;


public class UserinfoDAO extends BaseDAO {

	public Object delete(Object arg0) throws SQLException {
		boolean falg = false;
		String SQL = null;
		PreparedStatement ps = null;
		SQL = "DELETE FROM userinfo WHERE STU_NO=?";
		ps = conn.prepareStatement(SQL);
		ps.executeUpdate();
		falg = true;
		if (ps != null) {
			ps.close();
		}
		return falg;
	}

	public Object find() throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

	public Object find(Object arg0) throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

	public Object findAll() throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

	public Object findAll(Object arg0) throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

	public Object findById(Object arg0) throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

	public Object findByObject(Object arg0) throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

	public int getCount(Object arg0) throws SQLException {
		// TODO Auto-generated method stub
		return 0;
	}

	public Object getMaxId(Object arg0) throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

	public Object insert(Object arg0) throws SQLException {
		boolean flag = false;
		int ok = 0;
		PreparedStatement ps = null;
		UserinfoDTO udto = (UserinfoDTO)arg0;
		String SQL = null;
		int nIndex=1;
		SQL = "INSERT INTO bbsuserinfo(STU_NO,STU_NAME,BBS_POINT,PIC,IDIOGRAPH,SEND_COUNTS,REVERT_COUNTS) VALUES(?,?,?,?,?,?,?)";
		ps = conn.prepareStatement(SQL);
		ps.setInt(nIndex++, udto.getSTU_NO());
		ps.setString(nIndex++, udto.getSTU_NAME());
		ps.setString(nIndex++, udto.getBBS_POINT());
		ps.setString(nIndex++, udto.getPIC());
		ps.setString(nIndex++, udto.getIDIOGRAPH());
		ps.setInt(nIndex++, udto.getSEND_COUNTS());
		ps.setInt(nIndex++, udto.getREVERT_COUNTS());
		
		ok = ps.executeUpdate();
		if(ok!=-1)
		    flag = true;
		return flag;
	}


	public Object update(Object arg0) throws SQLException {
		boolean falg = false;
		PreparedStatement ps = null;
		UserinfoDTO udto = new UserinfoDTO();
		String SQL = null;
		int nIndex=1;
		SQL = "UPDATE bbsuserinfo SET STU_NAME=?,BBS_POINT=?,PIC=?,IDIOGRAPH=?,SEND_COUNTS=?,REVERT_COUNTS=? WHERE ID=STU_NO?";
		ps = conn.prepareStatement(SQL);
		ps.setString(nIndex++, udto.getSTU_NAME());
		ps.setString(nIndex++, udto.getBBS_POINT());
		ps.setString(nIndex++, udto.getPIC());
		ps.setString(nIndex++, udto.getIDIOGRAPH());
		ps.setInt(nIndex++, udto.getSEND_COUNTS());
		ps.setInt(nIndex++, udto.getREVERT_COUNTS());
		ps.setInt(nIndex++, udto.getSTU_NO());
		ps.executeUpdate();
		falg = true;
		if (ps != null) {
			ps.close();
		}
		SQL = null;
		
		return falg;
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -