请教,用jsp连mysql不成功,能加载驱动,但不能连接,
<%@ page import="java.sql.*" %>
<%
//声明
java.sql.Connection C;
try{
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
out.print("local driver sucess");
}
catch(Exception E){
out.print("unable to load driver.");
}
try{
C=DriverManager.getConnectio("jdbc:mysql://192.168.0.1:3306/test","user","pass");
out.print("connect mysql suess");
C.close();
}
catch(SQLException E){
out.print("false");
}
%>
把连接数据库注释掉,能显示'local driver sucess',但用连接数据库时这一页就打不开,端口不用或用8080也不行
二:我的jsp程序修改后运行但不编译,还是调用以前编译过的文件不知为什么