求救:关于Apach+Tomcat http://expert.csdn.net/Expert/topic/1135/1135286.xml?temp=.0293085照着配,一定行的!我就是这样的! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 上面的足以了,我在家一个数据库的连接!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> http://expert.csdn.net/Expert/topic/1429/1429950.xml?temp=.2134058 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 mod_jk-2.0.42.dll具體下載地址是什麼,我跑到官方網站找不到 load mod_jk-2.0.42.dll,最好使用绝对路径 遇到的问题是order by后面的字段是动态的,有时候用字段,有时候用字段(是asc或者desc)。参数 MYEC自带的服务器怎么配置环境变量? 是我眼花了吗,我看不出这句SQL哪里有错 关于frameset的问题 jsp显示中文问题 本人初学,想找个jsp+servlet+javabean的项目练习一下,,请问做什么项目比较好? 请问:j2ee的默认端口 求解释,求大神解释 JBuilder 8.0 安装问题,(在线等待) 关于include的问题,实在是搞不清楚。 开发JSP用什么工具好? 请问,如何获得当前的HttpServletRequest 对象呢??
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>
<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