出现一个问题:cannot be resolved to a type
result.jsp的内容如下:
<%@ page contentType="text/html; charset=UTF-8" language="java"%>
<%@ page import="Tools.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%
String book_type_type = request.getParameter("book_type_type");
DateBaseConn db = new DateBaseConn();
DateBaseConn dbc = null;
String sql = "select * from price";
dbc = db.Conn(sql);
%>
DateBaseConn.java:
import java.sql.*;
public class DateBaseConn
{
public void Conn(sql) throws SQLException
{
Connection conn = null;
Statement st = null;
ResultSet rs = null;
try{
Class.forName("oracle.jdbc.driver.OracleDriver");
}catch(ClassNotFoundException e)
{
System.out.println(e.getMessage());
}
try{
String url = "jdbc:oracle:thin:@localhost:1521:ORCL";
conn = DriverManager.getConnection(url,"ty","tyty");
st = conn.createStatement();
//String sql = "select * from price";
rs = st.executeQuery(sql);
while(rs.next())
{
System.out.println(rs.next());
}
}
catch(SQLException e)
{
System.out.println(e.getMessage());
}
}
}
其中DateBaseConn.java是放在Tools下的
为什么出现cannot resolved a type的错误?