www.pudn.com > Jsp-Blog.rar > UpdateLogDao.java, change:2010-05-25,size:750b


package myblog.dao; 
 
import java.sql.Connection; 
import java.sql.PreparedStatement; 
import java.sql.SQLException; 
 
import myblog.commons.ConnectionPool; 
 
public class UpdateLogDao { 
	public Connection conn = null; 
 
	public PreparedStatement pstmt = null; 
 
	public int logUpdate(String logtitle, String logcontent,String logid) { 
		int num = 0; 
		conn = ConnectionPool.getConnection(); 
		String sql = "update log set logtitle=? ,logcontent=? where logid=?"; 
		try { 
			pstmt = conn.prepareStatement(sql); 
			pstmt.setString(1, logtitle); 
			pstmt.setString(2, logcontent); 
			pstmt.setString(3, logid); 
		 
			num = pstmt.executeUpdate(); 
		} catch (SQLException e) { 
			 
			e.printStackTrace(); 
		} 
		return num; 
 
	} 
}