一个小问题  以前用得好好的  突然就报错了  没办法  琢磨了一下午没撒结果 上来问问..注意 sql语句前面是插入 后面紧跟着查询  报错内容:
com.microsoft.sqlserver.jdbc.SQLServerException: 该语句没有返回结果集。
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(Unknown Source)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(Unknown Source)源代码:
String sql="insert into T_QuestionInfo values(?,?,?,?,?,?,?,?,?,?,?,?,?);SELECT @@IDENTITY AS sid";
String[] paras={questionInfo.getType(),
questionInfo.getTitle(),
questionInfo.getContent(),
questionInfo.getToName(),
questionInfo.getReId(),
questionInfo.getTime(),
questionInfo.getToUrl(),
String.valueOf(questionInfo.getToId()),
String.valueOf(questionInfo.getToif()),
questionInfo.getKeywords(),
questionInfo.getType1(),
questionInfo.getType2(),
questionInfo.getType3()
};
rs=super.getResultSetBySqlPara(sql, paras);
getResultSetBySqlPara:
try {
con=Conn();
ps=con.prepareStatement(sql);
if(null!=paras && paras.length>0){
for (int i = 0; i < paras.length; i++) {
ps.setString(i+1, paras[i]);
}
}
return ps.executeQuery();
} catch (SQLException e) {
// TODO 自动生成 catch 块
e.printStackTrace();
closeDataBase();
System.out.println("getRes错误");

return null;