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

📄 followadd.java

📁 JSP简单的OA系统_非常不错的一个系统
💻 JAVA
字号:
package com.zh.util;
import java.sql.*;
import com.zh.conpool.*;
import com.bwm.string.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import com.zh.util.*;
public class followadd{
	String dattime;
	String linkman;
	String test;
	String result;
	int id;
	String str_table;
	Condata con;
	Str str=new Str();
	Infol Inf=new Infol();
	public followadd(){
	}
	public void Init(javax.servlet.http.HttpServletRequest req,javax.servlet.http.HttpServletResponse res)throws ServletException,IOException,SQLException{
		PrintWriter out=res.getWriter();
		con=new Condata();
		try{
			id=Integer.parseInt(req.getParameter("id"));
		}catch(Exception e){
		}
		dattime=str.toChinese(req.getParameter("dattime"));
		linkman=str.toChinese(req.getParameter("linkman"));
		test=str.toChinese(req.getParameter("test"));
		result=str.toChinese(req.getParameter("result"));
		str_table=req.getParameter("str_table");
		try{
			con.getConnection();
		}catch(Exception e){
		}
		Inf.InsertSql(str_table,id,dattime,linkman,test,result);
		if(getUpdate()==true){
			out.println("<br>");
			out.println("数据库维护成功");
			out.println("<script language='javascript'>parent.bottomFrame.location.reload();</script>");
			res.sendRedirect("Follow_Index.jsp");
		}else{
			out.println("<br>");
			out.println("数据库维护失败");
		}
		try{
			con.close();
			con=null;
		}catch(Exception e){
			e.getMessage();
		}
	
	}
	public boolean getUpdate(){
		boolean tag=false;
		try{
			con.getConnection();
		}catch(Exception e){
		}	
		int temp=0;
		temp=con.executeUpdate(Inf.InsertSql(str_table,id,dattime,linkman,test,result));
		if(temp>0){
			tag=true;
		}else{
			tag=false;
		}
		try{
			con.close();
			con=null;
		}catch(Exception e){
			e.getMessage();
		}
		return tag;
	}
}

⌨️ 快捷键说明

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