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

📄 stockupdate.java

📁 企业办公自动化管理系统
💻 JAVA
字号:
/* * Stockupdate.java * * Created on 2005年5月20日, 上午10:48 *//** * * @author  administrator */package com.zh.util;import com.zh.conpool.*;import javax.servlet.*;import javax.servlet.http.*;import com.bwm.string.*;import java.sql.*;import java.io.*;public class Stockupdate {    private String sql;    public Condata con;    public ResultSet rs;    Connection conn;    /** Creates a new instance of Stockupdate */    public Stockupdate() {    }  public void Init(javax.servlet.http.HttpServletRequest req,javax.servlet.http.HttpServletResponse res)throws ServletException,SQLException,IOException{    	PrintWriter out=res.getWriter();    	try{    		conn=con.getConnection();	    	}catch(Exception e){    		e.getMessage();	    	}    	int num=0;    	con=new Condata();    	rs=con.executeQuery(getSql());    	while(rs.next()){    		out.println("<tr align='center'>");    		out.println("<td height='26'>"+rs.getString(2)+"</td>");    		out.println("<td height='26'>"+rs.getDate(3)+"</td>");    		out.println("<td height='26'>"+rs.getString(4)+"</td>");    		out.println("<td height='26'>"+rs.getInt(5)+"</td>");    		out.println("<td height='26'>"+rs.getString(6)+"</td>");    		out.println("</tr>");    	}    	/*    	while(rs.next()){  			num++;  				  		out.println("<tr align='center'>");	    	out.println(	"<td height='26'>"+num+"</td>");	    	out.println(	"<td height='26'>"+rs.getString(2)+"</td>");	    	out.println(	"<td height='26'>"+rs.getDate(3)+"</td>");	    	out.println(	"<td height='26'>"+rs.getString(4)+"</td>");	    	out.println(	"<td height='26'>"+rs.getInt(5)+"</td>");	  		out.println(	"<td height='26'>"+rs.getInt(6)+"</td>");	  		out.println("</tr>");	  		  		}*/  		try{  			conn.close();  			conn=null;    		}catch(Exception e){  			e.getMessage();  		}  		try{  			con.close();  			con=null;  		}catch(Exception e){  			e.getMessage();  		}  		try{  			rs.close();  			rs=null;  		}catch(Exception e){  			e.getMessage();  		}  		  		    }    public String getSql(){    	sql="select * from tb_Stcokadd";    	return sql;    }    public ResultSet getRs(){    	try{    		con.getConnection();    	}catch(Exception e){    		e.getMessage();    	}    	con=new Condata();	    	try{    		rs=con.executeQuery(getSql());	    	}catch(Exception e){    		e.getMessage();    	}    	return rs;    }    public void Close(){    	try{    		conn.close();    		conn=null;    	}catch(Exception e){    		e.getMessage();    	}    	try{    		con.close();    		con=null;    	}catch(Exception e){    		e.getMessage();    	}    }}

⌨️ 快捷键说明

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