📄 feelaction.jsp
字号:
<!-------------------------------------------------------------
* @ 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
{
/*------------------------------------------------------------------------------------------------
* DB 目池记
-------------------------------------------------------------------------------------------------*/
%><%@ 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -