回 帖 发 新 帖 刷新版面

主题:有问题了...

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)

回复列表 (共4个回复)

沙发

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);
....
}

板凳

stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
                                              ResultSet.CONCUR_UPDATABLE);

3 楼

多谢

4 楼

好文章值得看一下!

我来回复

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