回 帖 发 新 帖 刷新版面

主题:请问问题发生在哪儿?急....

org.apache.jasper.compiler.ParseException: /test/dbconnectiontest.jsp(3,70) Attribute com.microsoft.jdbc.sqlserver.SQLServerDriver has no value
    at org.apache.jasper.compiler.JspReader.parseAttributeValue(JspReader.java:563)
    at org.apache.jasper.compiler.JspReader.parseTagAttributes(JspReader.java:681)
    at org.apache.jasper.compiler.Parser$Directive.accept(Parser.java:224)
    at org.apache.jasper.compiler.Parser.parse(Parser.java:1145)
    at org.apache.jasper.compiler.Parser.parse(Parser.java:1103)
    at org.apache.jasper.compiler.Parser.parse(Parser.java:1099)
    at org.apache.jasper.compiler.ParserController.parse(ParserController.java:214)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:210)
    at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:548)
    at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:176)
    at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:188)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
    at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
    at java.lang.Thread.run(Thread.java:536)

回复列表 (共5个回复)

沙发

dbconnectiontest.jsp
第三行.贴出来看看.

板凳

数据库的名,你使用的用户名密码,还有你要查找的表的名都对不对核实一下

3 楼

代码如下:(其实我的数据库是突然连不上的)

String driverName = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
     String url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=library";
     String user="sa";
     String password="sa";
     int retRowCount=-1;
     Connection conn =null;
     Statement stmt = null;
       
try{
    Driver driver = (Driver)Class.forName(driverName).newInstance();   
            conn = DriverManager.getConnection(url, user, password);

                stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
                                              ResultSet.CONCUR_UPDATABLE);
....
}
在jbuilder中调试,conn的值始终为null,即连不上

4 楼

如果是突然间连不上了,检查一下是不是中病毒了,不过可能性很小

好好检查一下你的数据库看看数据类型是否匹配,驱动程序对不对

还有就是写(Driver)Class.forName(........);前边那个Driver

不知道有什么.用,我连数据库的时候从来没那么写过。

没事的时候一起研究一下,我的QQ3434917

5 楼

谢谢诸位,我自己搞定了:)

我来回复

您尚未登录,请登录后再回复。点此登录或注册