FileDocCategorySizeDatePackage
UserDao.javaAPI DocExample838Tue Jun 08 15:57:54 BST 2004com.oreilly.strutsckbk.ch05

UserDao

public class UserDao extends Object

Fields Summary
Constructors Summary
Methods Summary
private java.sql.ConnectiongetConnection()

		Class.forName("com.mysql.jdbc.Driver");
		return DriverManager.getConnection("jdbc:mysql://localhost/test");
	
public org.apache.commons.beanutils.RowSetDynaClassgetUsersRowSet()

		Connection conn = null;
		Statement stmt = null;
		ResultSet rs = null;
		RowSetDynaClass rowSet = null;
		try {
			conn = getConnection();
			stmt = conn.createStatement();
			rs = stmt.executeQuery("select * from users");
			rowSet = new RowSetDynaClass(rs);			
		}
		finally {
			if (conn != null) conn.close();
		}
		return rowSet;