Jimmy Lopez

Greenhorn
+ Follow
since Mar 24, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jimmy Lopez

I am trying to use the Stringbuffer().

I am trying to display in a table if the String is to long show, then display an elipses
... at the end of the string in the table ??

How can I accomplish this ?

[ June 05, 2006: Message edited by: Jimmy Lopez ]
17 years ago
What if I am getting the data from a bean ? I do not need a new list so I should disregard the arraylist and get the list from the bean ? But how can I get the list into my table model ?
17 years ago
I am pretty new to this and I apologize, just syntacs how and where ?
17 years ago
Can you please give me an example ?
17 years ago
An example using my code please, I still not clear.
17 years ago
Can anyone tell me what is wrong logically with this code ?

public class SearchPageTableModel extends AbstractTableModel {


ArrayList list = new ArrayList();


public SearchPageTableModel() {
super();
for (int i = 0; i < getRowCount(); i++) {
ServicedeskAdhocBean rec = new ServicedeskAdhocBean();
list.add(rec);
}
}

public Object getValueAt(int row, int column) {

ServicedeskAdhocBean record = (ServicedeskAdhocBean) list.get(row);

switch (column) {
case 0 :
return record.getTicket_id();
case 1 :
return record.getTicket_title();
case 2 :
return record.getDepartment();
case 3 :
return record.getFirst_name();
case 4 :
return record.getLast_name();
default :
return "No value";
}
}
public int getColumnCount() {
return 5;
}
public int getRowCount() {
return list.size();
}

}
17 years ago
That code does is not doing what I want it to do, the numbers you see below they are A.M. Times. It supposed to begin from 6 to 10. How can I take the ten and put it at the end.


CODE DECODE_ONE
1000 10:00 //noticed in database looks like this but I am trying to
600 6:00 //make the top line go to the last in my query ???
615 6:15 // My query is: select code, decode_one
630 6:30 // from rts_code_dtl
645 6:45 // where category_cd = 34
700 7:00
715 7:15
730 7:30
745 7:45
800 8:00
815 8:15
830 8:30
845 8:45
900 9:00
915 9:15
930 9:30
945 9:45
[ March 29, 2006: Message edited by: Jimmy Lopez ]
CODE DECODE_ONE
100010:00 //noticed in database looks like this but I am trying to
6006:00 //make the top line go to the last in my query ???
6156:15 // My query is: select code, decode_one
6306:30 // from rts_code_dtl
6456:45 // where category_cd = 34
7007:00
7157:15
7307:30
7457:45
8008:00
8158:15
8308:30
8458:45
9009:00
9159:15
9309:30
9459:45
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.setSQL(sqlQuery.toString());
da.setString(1, department);
da.setString(2, PMTConstants.ACTIVE);

da.executeQuery();


while (da.next()) {
EmployeeBean emp = new EmployeeBean();
emp.setAuthId(da.getString("AUTH_ID"));
emp.setFirstName(da.getString("FIRST_NAME"));
emp.setLastName(da.getString("LAST_NAME"));
emp.setActiveInd(da.getString("ACTIVE_IND"));
emp.setTaskInd(da.getString("TASK_IND"));
emp.setProjectInd(da.getString("PROJECT_IND"));

employeeList.add(emp);
}

if (da != null) {
da.close();
}


return employeeList;
} // end of selectEmployeeList


Any suggestions ?