双11狂欢大促

盲盒赢 定制羽绒服

开启惊喜盲盒,抽取你的专属好礼

— 惊喜奖品抢先看 —

出现一个问题:cannot be resolved to a type

ianafollow ianafollow 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
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的错误?
...全文
评论 9
收藏 已收藏
分享
返回顶部
ianafollow
Java SE 62,621 成员 307,251 内容