Demo entry 6754354

Bi.java

   

Submitted by anonymous on Jul 10, 2018 at 13:52
Language: Java. Code size: 976 Bytes.

//根据ID号查询转让记录
	public Records GetRecordById(String id)
	{
		Records record=new Records();
		String sql="select * from record where recordID=?";
		String parameters[]={id};
		ResultSet rs=SqlHelper.executeQuery(sql, parameters);
		try {
			if(rs.next())
			{
				record.setRecordID(rs.getInt(1));
				record.setContractID(rs.getString(2));
				record.setOutcomeName(rs.getString(3));
				record.setManager(rs.getString(4));
				record.setDiscipline(rs.getString(5));
				record.setDepartment(rs.getString(6));
				record.setVerifyDate(rs.getDate(7));
				record.setMoney(rs.getDouble(8));
				record.setCompany(rs.getString(9));
				record.setCompanyPhone(rs.getString(10));
				record.setComments(rs.getString(11));
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}finally{
			//反向引用,关闭资源
			SqlHelper.close(SqlHelper.getCt(), SqlHelper.getPs(), SqlHelper.getRs());
			
		}

		return record;
	}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).