>>>>>>out cannot be resolved 没看到你所有的代码,只能估计你是在<%!%>中使用out了,请尝试在<%%>中使用看看
An error occurred at line: 1 in the jsp file: /liuyan/Conn.jsp out cannot be resolved 1: <%! 2: Connection con = null; 3: Statement stmt = null; 4: ResultSet rs = null; 能将你Conn.jsp贴出来么 估计是out这个变量没有定义
type Status reportmessage /ch12/liuyan/con.jspdescription The requested resource (/ch12/liuyan/con.jsp) is not available. --------------------------------------------------------------------------------Apache Tomcat/6.0.10 运行结果如上面的。我的数据库是mysql5.1.3版本的,jdbc驱动是5.1.7的
没看到你所有的代码,只能估计你是在<%!%>中使用out了,请尝试在<%%>中使用看看
out cannot be resolved
1: <%!
2: Connection con = null;
3: Statement stmt = null;
4: ResultSet rs = null;
能将你Conn.jsp贴出来么 估计是out这个变量没有定义
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
public void jspInit()
{
try
{
String userName="root";
String dbName="message";
String tableName="message";
String userpwd=" ";
Class.forName("org.gjt.mm.mysql.jdbc.Driver").newInstance(); //载入驱动程式类别
con = DriverManager.getConnection("jdbc:mysql://localhost:3306/"+dbName+"?user="+userName+"&password="+userpwd); //建立数据库连接
//建立Statement变量
//out.print("数据库连接成功");
stmt = con.createStatement();
}
catch(Exception ex)
{
System.out.println(ex.toString());
}
}%>
--------------------------------------------------------------------------------Apache Tomcat/6.0.10
运行结果如上面的。我的数据库是mysql5.1.3版本的,jdbc驱动是5.1.7的