菜鸟求助!将arraylist中的查询结果插入数据库该怎么做啊
从来没有接触过代码,上来就让弄这个,实在没头绪,关键是时间紧,请帮忙了!!!
有一个查询结果列表的jsp页面
<%@ page contentType= "text/html;charset=GBK " %>
<%@ page import= "java.util.* "%>
<%@ page import= "web.vrlab.gsmis.action.xj.pages.Xjpages "%>
<%@ taglib uri= "/WEB-INF/struts-bean.tld " prefix= "bean " %>
<%@ taglib uri= "/WEB-INF/struts-html.tld " prefix= "html " %>
<%@ taglib uri= "/WEB-INF/struts-logic.tld " prefix= "logic " %>
<%
String ctxPath = request.getContextPath();
String nowSesson = (String)request.getSession().getAttribute( "zcSesson ");
nowSesson = nowSesson.equals( "spring ")? "春 ": "秋 ";
String nowYear = (String)request.getSession().getAttribute( "zcYear ");
String submitType = (String)request.getSession().getAttribute( "zcSubmitType ");
%>
<link href= " <%=ctxPath%> /css/phonenix.css " rel= "stylesheet " type= "text/css ">
<script language= 'javascript ' src= ' <%=ctxPath%> /js/dm/DM_XB.js '> </script>
<script language= 'javascript ' src= ' <%=ctxPath%> /js/dm/DM_BXZY.js '> </script>
<script language= 'javascript ' src= ' <%=ctxPath%> /js/dm/DM_YXDM.js '> </script>
<script language= 'javascript ' src= ' <%=ctxPath%> /js/dm/DM_ZCXX.js '> </script>
<script language= "javascript ">
function get_dm_value(v,def_dm)
{
var str = '未知 ';
for (var x in def_dm)
{
if(v == x)
{
str = def_dm[x];
return str;
}
}
return str;
}
</script>
<%@ page session= "true "%>
<table>
<tr class= "tablefont3 " bgcolor= "#6699CC ">
<td colspan= '4 '>
学生注册情况 学生列表
</td>
</tr>
<%
int flag=-1;
ArrayList SList = (ArrayList)request.getAttribute( "studentList ");
if(SList!= null)
{
String rowIndex= " ";
for(int i=0; i <SList.size(); i++)
{
flag=-flag;
if(flag <0)
{
out.print( " <tr bgcolor= '#eaffe0 ' class= 'tablefont1 '> ");
}
else
{
out.print( " <tr bgcolor= '#eaeeff 'class= 'tablefont1 '> ");
}
String sInf[] = (String[])SList.get(i);
rowIndex = (sInf[9]!=null) ? sInf[9]: " "+(i+1)+ " ";
out.print( " <td> <font color= 'red '> "+ rowIndex + " </font> </td> ");
out.print( " <td> "+ sInf[0] + " </td> ");
out.print( " <td> <a href= 'javascript:getStuDetail(\ " "+sInf[0]+ "\ ") '> "+ sInf[1] + " </a> </td> ");