⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ex8_6.txt

📁 j2ee core design patterns
💻 TXT
字号:
Example 8.6 	CustomerDAO.java: Cached RowSet Strategy
package com.corej2eepatterns.dao;

// imports

public class CustomerDAO {
	. . .  

	// Create the CachedRowSet using the 
	// ResultSet from query execution    
	public RowSet findCustomersRS(CustomerTO criteria)    
			throws DAOException {

		Connection con = getConnection();
		javax.sql.RowSet rowSet = null;
		String searchSQLString = getSearchSQLString(criteria);
		try {
			con = getConnection();
			java.sql.Statement stmt =
					con.createStatement(. . . );.
			java.sql.ResultSet rs =
					stmt.executeQuery(searchSQLString);
			rowSet = new CachedRowSet();
			rowSet.populate(rs); 
		} catch (SQLException anException) {
			// handle exception

⌨️ 快捷键说明

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