feelaction.jsp
来自「用手机浏览的一个类似于聊天室 博克 homepage 等 对这方面有 兴趣的朋友」· JSP 代码 · 共 67 行
JSP
67 行
<!-------------------------------------------------------------
* @ name: feelAction.jsp
* @ Author : ranxu
* @ date :2008-06-27
-------------------------------------------------------------->
<%@ page import='java.io.*,java.text.*,java.util.Date,java.util.Vector, java.sql.*, com.entaz.lib.db.*, com.entaz.relay.net.*' contentType='text/html;charset=euc-kr'%>
<%@ include file="../imgpath.jsp"%>
<%@ include file="../common_func.jsp"%>
<%@ include file="appConstants.jsp"%>
<%@ include file="formatUtil.jsp"%>
<%@ include file="../makeKOR.jsp"%>
<%
/*------------------------------------------------------------------------------------------------------
+ parameter from last page
-------------------------------------------------------------------------------------------------------*/
String mphone = request.getParameter("mphone");
String gphone = request.getParameter("gphone");
mphone = getStrPhone(getLong(mphone));
gphone = getStrPhone(getLong(gphone));
String actionStates = request.getParameter("actionStates");
String moodVal = request.getParameter("mood");
String currentDate = request.getParameter("currentDate");
if(moodVal==null||moodVal.equals("")){
response.sendRedirect(url_path+"/news/feelRegFail.jsp?mphone="+mphone+"&gphone="+gphone);
}
/*------------------------------------------------------------------------------------------------------
+ DB 包访 函荐
-------------------------------------------------------------------------------------------------------*/
PreparedStatement pstmt = null;
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
String sql = "";
int ret = -1;
try
{
/*------------------------------------------------------------------------------------------------
* insert or update Ok or fail
-------------------------------------------------------------------------------------------------*/
%><%@ include file="../getConnection.jsp"%><%
if(actionStates.equalsIgnoreCase("insert")){
sql="INSERT INTO gt_nsmood (state,phonenum,regdate) VALUES(?,?,?)";
}else if(actionStates.equalsIgnoreCase("update")){
sql="UPDATE gt_nsmood SET state=? WHERE phonenum = ? AND regdate=?";
}
pstmt = con.prepareStatement(sql);
pstmt.setInt(1,getInt(moodVal));
pstmt.setLong(2,getLong(mphone));
pstmt.setString(3,currentDate);
ret = pstmt.executeUpdate();
if (ret == -1){
response.sendRedirect(url_path+"/news/feelRegFail.jsp?mphone="+mphone+"&gphone="+gphone);
return;
}else{
response.sendRedirect(url_path+"/news/feelRegOK.jsp?mphone="+mphone+"&gphone="+gphone);
}
%>
<%
}catch(Exception e){
System.out.println(e);
}finally{
if(rs != null) try{ rs.close(); }catch(Exception se){}
if(pstmt != null) try{ pstmt.close(); }catch(Exception se){}
if(stmt != null) try{ stmt.close(); }catch(Exception se){}
if(con != null) try{ con.close(); }catch(Exception se){}
}
%>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?