This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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 ( {
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:
subject: JDBC