src/t/o/bean/DBfood.java

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

package t.o.bean;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;

public class DBfood {
	public static int uploadFood(String sql){
		int result = 0;
		Connection conn=null;
		Statement stmt=null;
		ResultSet rs=null;
		
		try {
			conn = DBmessage.getConnection();
			stmt = conn.createStatement();
			result = stmt.executeUpdate(sql);
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			result = 0;
		}
		finally{
			DBmessage.allClose(conn, stmt, rs);
		}
		return result;
	}
	public static ArrayList<foodBean> getfm(String sql){
		ArrayList<foodBean> foodList = new ArrayList<foodBean>();
		
		Connection conn = null;
		Statement stmt = null;
		ResultSet rs = null;
		try {
			conn = DBmessage.getConnection();
			stmt = conn.createStatement();
			rs = stmt.executeQuery(sql);
			
			while(rs.next()){
				String Food_no = rs.getString("o_foodNo").trim();
				String Food_name = rs.getString("o_foodName").trim();
				String Food_type = rs.getString("o_foodType").trim();
				String Food_price = rs.getString("o_foodPrice").trim();
				String Food_cook = rs.getString("o_foodCook").trim();
				String Food_synopsis = rs.getString("o_foodSynopsis").trim();
				String Food_remark = rs.getString("o_foodRemark").trim();
				foodBean foodbean = new foodBean(Food_no,Food_name,Food_cook,Food_type,Food_price,Food_synopsis,Food_remark);
				foodList.add(foodbean);
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		finally{
			DBmessage.allClose(conn, stmt, rs);
		}
		return foodList;
	}

后面还有 22 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。