The moose likes JDBC and the fly likes JDBC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC" Watch "JDBC" New topic


Jimmy Lopez

Joined: Mar 24, 2006
Posts: 9
Good day everyone, I am an entry level Java developer and I am trying to figure out this code;

public LinkedList selectEmployeeList(String department)
throws ServletException, WalgreensDataException, PMTException {

DataAccess da = null;
LinkedList employeeList = new LinkedList();
StringBuffer sqlQuery = new StringBuffer();
sqlQuery.append("select dept.auth_id, ");
sqlQuery.append("emp.first_name, ");
sqlQuery.append("emp.last_name, ");
sqlQuery.append("emp.active_ind, ");
sqlQuery.append("emp.task_ind, ");
sqlQuery.append("emp.project_ind ");
sqlQuery.append("from rts_employee emp, ");
sqlQuery.append("rts_emp_dept dept ");
sqlQuery.append("where emp.auth_id = dept.auth_id ");
sqlQuery.append("and dept.department = ? ");
sqlQuery.append("and dept.default_dept_ind = ? ");
sqlQuery.append("order by active_ind desc, emp.last_name");

da = new DataAccess(conn, sqlQuery.toString());
da.setString(1, department);
da.setString(2, PMTConstants.ACTIVE);


while (da.next()) {
EmployeeBean emp = new EmployeeBean();


if (da != null) {

return employeeList;
} // end of selectEmployeeList

Any suggestions ?
stu derby
Ranch Hand

Joined: Dec 15, 2005
Posts: 333

I am trying to figure out this code;

Any suggestions ?

Ask a more specific question. Are you saying that this is your code and doesn't work? How not? Or is the code you found some where and you want to know what it does and how it works?

Here's a commented version (with a minor change or two); not the effect of using the code tags to make it more readable.

Hope that helps.
I agree. Here's the link: http://aspose.com/file-tools
subject: JDBC
Similar Threads
JUnit on eclipse
How to test the implemention of Singleton pattern?
Test for equality of two objects
Hibernate in case of cascade(All,merge,persist)
Displaying the data from the list in JSP