football_005flottery_005fcast_jsp.java
来自「手机在线系统 采用Java 中的J2ME, JSP 跟MySql 运行环」· Java 代码 · 共 135 行
JAVA
135 行
package org.apache.jsp.football.football_005flottery;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.sql.*;
import com.j2me.common.*;
import com.j2me.data.*;
public final class football_005flottery_005fcast_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static java.util.Vector _jspx_dependants;
public java.util.List getDependants() {
return _jspx_dependants;
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
JspFactory _jspxFactory = null;
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
_jspxFactory = JspFactory.getDefaultFactory();
response.setContentType("text/html; charset=gb2312");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("<HTML>\r\n");
out.write("\r\n");
out.write("<HEAD>\r\n");
out.write("\r\n");
out.write("<TITLE> New Document </TITLE>\r\n");
out.write("\r\n");
out.write("</HEAD>\r\n");
out.write("\r\n");
out.write("<BODY>\r\n");
/**
* @(#)register.jsp 1.11 01/08/23
* Copyright (c) 2004-2005 wuhua of workroom Inc. All Rights Reserved.
* @version 1.0, 10/05/2004
* @author 饶荣庆
* @author 余煜辉
*/
/*此文件用于获得足球彩票用户投注的数据并保存到数据库中*/
FootBall foot = null; //数据库对象类,连接后用来显示数据,插入数据。
String result = request.getParameter("result"); //获得用户进行足彩投注的数据
//String data = request.getParameter("data"); //获得用户进行投注后联系的地址及其他信息
String sql = "insert into football_lottery_name values(?);"; //用户插入的数据库语句
try
{
/*创建一个数据库连接对象*/
foot = new FootBall();
foot.connect(); //连接数据库
}
catch(ClassNotFoundException e)
{
out.println("Error");
}
catch(SQLException sqlexception)
{
//如果发现异常则输出不为true的信息返回客户端,
out.println("Error");
}
try
{
int[] point = DisposeData.getIntGroup(result, "~", 3);
for (int j=0; j<point.length; j++)
{
out.println(point[j]);
}
/*利用循环把用户竟猜的数据写入数据库里*/
for(int i = 0; i < 13; i++)
{
foot.insertData(sql, null, point[i], 0);
}
//如果成功则返回true以便客户端进行判断,
out.println("True");
}
catch(SQLException sqlexception)
{
out.println(sqlexception.getMessage()); //输出连接错误
}
//注销连接
foot.disconnect();
out.write("\r\n");
out.write("\r\n");
out.write("</BODY>\r\n");
out.write("</HTML>\r\n");
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
}
} finally {
if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?