ex8_9.txt

来自「j2ee core design patterns」· 文本 代码 · 共 41 行

TXT
41
字号
Example 8.9 CustomerDAO.java: Creating the RowSetWrapperList
package com.corej2eepatterns.dao;

// imports

public class CustomerDAO {
	. . .  

	public List findCustomersRL(
			CustomerTO cust, int startAtRow, int howManyRows) 
			throws Exception{
		// create the search SQL string 
		String searchSQLString = getSearchSQLString(cust);

		// execute the search
		return executeSearch(searchSQLString,    
				StartAtRow, howManyRows);
	}

	private List executeSearch(
			String searchSQLString, int startAtRow,
			int howManyRows)
			throws Exception {

		RowSetWrapperList results = null;
		try {
			RowSet rowSet = getRORowSet(searchSQLString, 
					int startAtRow,
					int howManyRows);

			results = new RowSetWrapperList (rowSet);
		} catch (Exception ex) {
			throw new Exception(ex);
		} 

		return results;
	}

	private String getSearchSQLString(CustomerTO cust) {
		// convenience method to create and return
		// a 揝ELECT

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?