当前位置: 技术问答>java相关
请版主帮忙!!!
来源: 互联网 发布时间:2017-03-18
本文导语: 不对之处请指正! Vector v=new Vector(); Vector w=new Vector(); Vector p=new Vector(); try{ sql0="select mctfanswer, shortanswer from questions where classid='"+courseid+"' and ...
不对之处请指正!
Vector v=new Vector();
Vector w=new Vector();
Vector p=new Vector();
try{
sql0="select mctfanswer, shortanswer from questions where classid='"+courseid+"' and type='"+type+"' order by assignid";
stmt0=con.createStatement();
result0=stmt0.executeQuery(sql0);
while(result0.next())
{
String mctf=result0.getString(1);
String shortanswer=result0.getString(2);
Vector rows=new Vector(2,1);
rows.addElement(mctf);
rows.addElement(shortanswer);
v.addElement(rows);
}
result0.close();
stmt0.close();
}catch (SQLException Ex) {
out.println("query questions failed");
}
try{
sql1="select mctfanswer,shortanswer from submittedqs where classid='"+courseid+"' and type='"+type+"' and userid='"+userid+"' order by assignid";
stmt01=con.createStatement();
result01=stmt01.executeQuery(sql1);
while(result01.next())
{
String submctf=result01.getString(1);
String subshort=result01.getString(2);
Vector rows0=new Vector(2,1);
rows0.addElement(submctf);
rows0.addElement(subshort);
w.addElement(rows0);
}
result01.close();
stmt01.close();
}catch (SQLException Ex) {
out.println("query questions failed");
}
try{
sql10="select points from questions where classid='"+courseid+"' and session='"+section+"' and type='"+type+"' order by assignid";
stmt0=con.createStatement();
result0=stmt0.executeQuery(sql0);
while(result0.next())
{
points=result0.getInt(1);
Vector rows1=new Vector(1,1);
rows1.addElement(points);
p.addElement(rows1);
}
result01.close();
stmt01.close();
}catch (SQLException Ex) {
out.println("query questions failed");
}
for(int i=1;i
Vector v=new Vector();
Vector w=new Vector();
Vector p=new Vector();
try{
sql0="select mctfanswer, shortanswer from questions where classid='"+courseid+"' and type='"+type+"' order by assignid";
stmt0=con.createStatement();
result0=stmt0.executeQuery(sql0);
while(result0.next())
{
String mctf=result0.getString(1);
String shortanswer=result0.getString(2);
Vector rows=new Vector(2,1);
rows.addElement(mctf);
rows.addElement(shortanswer);
v.addElement(rows);
}
result0.close();
stmt0.close();
}catch (SQLException Ex) {
out.println("query questions failed");
}
try{
sql1="select mctfanswer,shortanswer from submittedqs where classid='"+courseid+"' and type='"+type+"' and userid='"+userid+"' order by assignid";
stmt01=con.createStatement();
result01=stmt01.executeQuery(sql1);
while(result01.next())
{
String submctf=result01.getString(1);
String subshort=result01.getString(2);
Vector rows0=new Vector(2,1);
rows0.addElement(submctf);
rows0.addElement(subshort);
w.addElement(rows0);
}
result01.close();
stmt01.close();
}catch (SQLException Ex) {
out.println("query questions failed");
}
try{
sql10="select points from questions where classid='"+courseid+"' and session='"+section+"' and type='"+type+"' order by assignid";
stmt0=con.createStatement();
result0=stmt0.executeQuery(sql0);
while(result0.next())
{
points=result0.getInt(1);
Vector rows1=new Vector(1,1);
rows1.addElement(points);
p.addElement(rows1);
}
result01.close();
stmt01.close();
}catch (SQLException Ex) {
out.println("query questions failed");
}
for(int i=1;i
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
站内导航:
特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!