日期:2014-05-17 浏览次数:20807 次
var url = "bets.jsp?v_guess="+document.getElementById("max1").name +"&v_bets="+document.getElementById("bets1").value +"&v_gameman="+document.getElementById("gameman").innerHTML; XMLHttpReq.open("GET", url, true); XMLHttpReq.send(null); // 发送请求
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ page import="javax.naming.Context"%> <%@ page import="javax.naming.InitialContext"%> <%@ page import="java.sql.*"%> <% Statement stmt = null; ResultSet rst = null; Context ctx = new InitialContext(); javax.sql.DataSource ds = (javax.sql.DataSource) ctx .lookup("oracledatesource");//建立数据库 java.sql.Connection conn = ds.getConnection(); stmt = conn.createStatement(); //获取index传过来的值 String v_guess = request.getParameter("v_guess"); String v_bets = request.getParameter("v_bets"); String v_gameman = request.getParameter("v_gameman"); //执行存储过程 String procedure1 = "{call game_button('"+v_gameman+"')}"; CallableStatement cstmt1 = conn.prepareCall(procedure1); cstmt1.executeUpdate(); //执行存储过程 String procedure = "{call game_js("+v_bets+","+v_guess+",'"+v_gameman+"')}"; CallableStatement cstmt = conn.prepareCall(procedure); cstmt.executeUpdate(); out.close(); rst.close(); conn.close(); %>