专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > Java Exception

java.sql.SQLException: [Microsoft][SQLServer JDBC Driver]Unexpected token type: ERROR

发布时间:2010-06-05 12:27:04 文章来源:www.iduyao.cn 采编人员:星星草

我的javaBean代码如下:
package chdetailPac;
import java.sql.*;
import DB.connection;
import java.lang.*;
public class getDetail
{
connection con;
public getDetail()
{
con=new connection();

}
public ResultSet getDetailInfo(String strType)
{
strType= "select insInfo.* from insInfo ,ins,minor where insInfo.insName=ins.insName and ins.ID=minor.ID and minor.ID= "+strType+ " ";
return con.executeQuery(strType);
}
}
jsp代码:
<%
String id=new String(request.getParameter( "id ").getBytes( "ISO-8859-1 "), "gb2312 ");
ResultSet rs=getDetail.getDetailInfo(id);
rs.next();
%>
在运行过程中出现了错误:
java.sql.SQLException: [Microsoft][SQLServer JDBC Driver]Unexpected token type: ERROR
com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
com.microsoft.jdbc.sqlserver.tds.TDSRequest.getRow(Unknown Source)
com.microsoft.jdbc.sqlserver.SQLServerImplResultSet.positionCursor(Unknown Source)
com.microsoft.jdbc.base.BaseResultSet.next(Unknown Source)
org.apache.jsp.chsubDetail_jsp._jspService(chsubDetail_jsp.java:66)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

请各位高手帮帮忙,以前我在ACCESS数据库中就可以运行,但转到SQL server就出现了问题,我运行其它的SQL语句都可以 ,应该不是驱动的问题了。

------解决方法--------------------------------------------------------
你参数的名字和你的sql语句的变量同名了,能不错吗?
把参数换个名字.
------解决方法--------------------------------------------------------
呵呵

    
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: