Package org.openqreg.bean

Examples of org.openqreg.bean.BrowserBean


* @return A populated BrowserBean
*
* @throws SQLException
*/
protected static BrowserBean populate(ResultSet rs) throws SQLException {
BrowserBean valueObject = new BrowserBean();
valueObject.setId((Long)rs.getObject(1));
valueObject.setBrowsername((String)rs.getObject(2));
valueObject.setBrowserdisplayname((String)rs.getObject(3));
valueObject.setStatus((Integer)rs.getObject(4));
return valueObject;
}
View Full Code Here


* @throws SQLException
*/
public static Collection<BrowserBean> findAll(Connection con) throws SQLException {
PreparedStatement pStmt = null;
ResultSet rs = null;
BrowserBean valueObject = null;
Collection<BrowserBean> col = Collections.synchronizedList(new ArrayList<BrowserBean>());
try{
pStmt = con.prepareStatement(FIND_ALL_STATEMENT);
rs = pStmt.executeQuery();
while (rs.next()){
valueObject = populate(rs);
valueObject.afterPopulate(con);
col.add(valueObject);
}
return col;
}finally{
if(null!=rs){
View Full Code Here

* @throws SQLException
*/
public static Object findByPrimaryKey(Connection con, PrimaryKey key) throws SQLException {
PreparedStatement pStmt = null;
ResultSet rs = null;
BrowserBean valueObject = null;
BrowserKey primaryKey = (BrowserKey) key;
try{
pStmt = con.prepareStatement(BrowserBeanBase.SELECT_STATEMENT);
pStmt.setObject(1, primaryKey.getId());
rs = pStmt.executeQuery();
while (rs.next()){
valueObject = populate(rs);
valueObject.afterPopulate(con);
}
return valueObject;
}finally{
if(null!=rs){
rs.close();
View Full Code Here

    if (hasService(userId, service)) {
      Connection con = null;
      try {
        con = DbHandler.getConnection();
        con.setAutoCommit(false);
        BrowserBean browser = (BrowserBean) BrowserFinderBase
            .findByPrimaryKey(con, new BrowserKey(browserId));
        browser.remove(con);
        con.commit();

      } catch (SQLException sqle) {
        try {
          if (null != con) {
View Full Code Here

    if (hasService(userId, service)) {
      Connection con = null;
      try {
        con = DbHandler.getConnection();
        con.setAutoCommit(true);
        BrowserBean browser = new BrowserBean();
        browser.setBrowsername(browserName);
        browser.setBrowserdisplayname(browserDisplayName);
        browser.setStatus(browserStatus);
       
        browser.create(con);
      } catch (SQLException sqle) {
        try {
          if (null != con) {
            con.rollback();
          }
View Full Code Here

    if (hasService(userId, service)) {
      Connection con = null;
      try {
        con = DbHandler.getConnection();
        con.setAutoCommit(true);
        BrowserBean browser = (BrowserBean)BrowserFinderBase.findByPrimaryKey(new BrowserKey(browserId));
        browser.setStatus(newStatus);
        browser.store(con);
      } catch (SQLException sqle) {
        try {
          if (null != con) {
            con.rollback();
          }
View Full Code Here

TOP

Related Classes of org.openqreg.bean.BrowserBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.