驱动应该没什么问题,呵呵,是不是就是把三个文件拷贝到resin中lib的目录下面啊?

解决方案 »

  1.   

    高手,能不能帮忙look look??谢了先
      

  2.   

    <%@ page contentType="text/html; charset=GBK" %>
    <%@ page import= "java.sql.*" %>
    <html>
    <head>
    <title>
    jsp_sqlserver
    </title>
    </head>
    <body bgcolor="#ffffff">
    <h1>
    JBuilder Generated JSP
    </h1><br>
    <%
        try
        {
          Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
      out.println("找到驱动!!");
     
      
    Connection conn = DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=merchant","sa","");
    out.println("conn:"+conn);
      out.println("连接成功!!!");
          Statement statement = conn.createStatement();
          ResultSet authorName = statement.executeQuery("select * from tbuser");
      out.println("执行查询!!!");
       
         while(authorName.next())
            out.println("<tr><td>"+authorName.getString(1)+"</td></tr><br>");
        }
        catch(ClassNotFoundException e)
        {
          out.println("Driver unavailable!!!!");

        }
        catch(SQLException e)
        {
          System.err.println(e);
        }%>
    </body>
    </html>
    应该是你的驱动写的不对,你参考一下这个