| File: | /WEB-INF/classes/net/incru/tagexample/bean/QueryGenerator.java |
| Permissions: | 0640 |
/**
* Bean for example of using database SQL
*/
package net.incru.tagexample.bean;
public class QueryGenerator {
private static final String TABLE_NAME = "example";
private String _rows;
/**
* Bean methods (set-get).
* MUST be both!
*/
public void setRows(String nRows) {
_rows = nRows;
}
public String getRows() {
return _rows;
}
public String getQuery() {
int limit;
try {
limit = Integer.parseInt(_rows);
} catch (NumberFormatException ex) {
limit = 0;
}
return "select * from "+TABLE_NAME+" "+ (limit > 0 ? " limit " + limit : "");
}
}
www.Net.ru - веб хостинг и регистрация доменов - web-hosting and domain registration