http://expert.csdn.net/Expert/topic/1135/1135286.xml?temp=.0293085
照着配,一定行的!
我就是这样的!

解决方案 »

  1.   

    上面的足以了,我在家一个数据库的连接!
    http://www.microsoft.com/downloads/details.aspx?FamilyID=4f8f2f01-1ed7-4c4d-8f7b-3d47969e66ae&DisplayLang=en#filelist下载JDBC驱动程序。安装,得到msbase.jar,mssqlserver.jar和msutil.jar三个文件,将三个文件COPY到TOMCAT 4.1下common\lib文件夹中。
    用jsp测试。
    <%@ page contentType="text/html;charset=gb2312"%>   
    <%@ page import="java.sql.*"%> 
    <html>   
    <body>   
    <%Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();   
    String url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=mydb"; 
    //mydb为你的数据库
    String user="sa"; 
    String password=""; 
    Connection conn= DriverManager.getConnection(url,user,password);   
    Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);   
    String sql="select * from tongxue";  //你的数据库中的表 
    ResultSet rs=stmt.executeQuery(sql);   
    while(rs.next()) {%>   
    您的第一个字段内容为:<%=rs.getString(1)%>   
    您的第二个字段内容为:<%=rs.getString(2)%>   
    <%}%>   
    <%out.print("数据库操作成功,恭喜你");%>   
    <%rs.close();   
    stmt.close();   
    conn.close();   
    %>   
    </body>   
    </html>
      

  2.   

    http://expert.csdn.net/Expert/topic/1429/1429950.xml?temp=.2134058
      

  3.   

    1. 下载mod_jk2-2.0.43.dll,并将它复制到APACHE安装目录下的modules子目录下。 2. 编辑APACHE2的配置文件httpd.conf,在文件的最后加上以下几行。 LoadModule jk2_module modules/mod_jk2-2.0.43.dll 
    <VirtualHost *> 
    ServerAdmin [email protected] 
    DocumentRoot "D:/jakarta-tomcat-4.1.12/webapps" 
    ServerName dummy-host.example.com 
    DirectoryIndex index.htm index.html index.jsp 
    ErrorLog logs/dummy-host.example.com-error_log 
    CustomLog logs/dummy-host.example.com-access_log common 
    </VirtualHost> 其中DocumentRoot一行要与自己的TOMCAT安装目录一致。 
    DirectoryIndex一行是为了自动解释JSP类型的文件。 3. 在APACHE2安装目录的conf子目录下加入文件workers2.properties,其内容如下:[shm] 
    file=${serverRoot}/logs/shm.file 
    size=1048576 # Example socket channel, override port and host. 
    [channel.socket:localhost:8009] 
    port=8009 
    host=127.0.0.1# define the worker 
    [ajp13:localhost:8009] 
    channel=channel.socket:localhost:8009 # Uri mapping 
    [uri:/*] 
    worker=ajp13:localhost:8009
      

  4.   

    mod_jk-2.0.42.dll具體下載地址是什麼,我跑到官方網站找不到
      

  5.   

    load mod_jk-2.0.42.dll,最好使用绝对路径