src/t/o/bean/DBcomposition.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 DBcomposition {
	public static int uploadc(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<compositionBean> getcm(String sql){
		ArrayList<compositionBean> compositionList = new ArrayList<compositionBean>();
		
		Connection conn = null;
		Statement stmt = null;
		ResultSet rs = null;
		try {
			conn = DBmessage.getConnection();
			stmt = conn.createStatement();
			rs = stmt.executeQuery(sql);
			
			while(rs.next()){
				String c_no = rs.getString("o_cNo").trim();
				String c_title = rs.getString("o_cTitle").trim();
				String c_type = rs.getString("o_cType").trim();
				String c_date = rs.getString("o_cDate").trim().substring(0,10);
				String c_c = rs.getString("o_cContent").trim();
				compositionBean compositionbean = new compositionBean(c_no,c_title,c_type,c_date,c_c);
				compositionList.add(compositionbean);
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		finally{
			DBmessage.allClose(conn, stmt, rs);
		}
		return compositionList;
	}

	public static int getrs(String sql){
		int size = 0;
后面还有 20 行代码,购买后查看完整代码

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

AI 解读

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

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