Package com.dev.trade.exception

Examples of com.dev.trade.exception.DBException


            .getString(3), rs.getString(4), rs.getFloat(5));
      }
      pStmt.close();
    } catch (SQLException ex) {
      ex.printStackTrace();
      throw new DBException(ex.getMessage());
    }

    return user;
  }
View Full Code Here


        stocks.add(stock);
      }
      pStmt.close();
    } catch (SQLException ex) {
      ex.printStackTrace();
      throw new DBException(ex.getMessage());
    }
    return stocks;
  }
View Full Code Here

        stocks.add(stock);
      }
      pStmt.close();
    } catch (SQLException ex) {
      ex.printStackTrace();
      throw new DBException(ex.getMessage());
    }
    return stocks;
  }
View Full Code Here

        cash = rs.getFloat("cash");
      }
      pStmt.close();
    } catch (SQLException ex) {
      ex.printStackTrace();
      throw new DBException(ex.getMessage());
    }
    return cash;
  }
View Full Code Here

        }
        con.setAutoCommit(true);
      } catch (SQLException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
        throw new DBException(e.getMessage());
      }
    } else if (cashAvailable >= 0 && (availableStock == quantity)) {
      try {
        con.setAutoCommit(false);
        if (setUserCash(userId, cashAvailable)
            && addUserStock(userId, stockId, availableStock)) {
          con.commit();
        } else {
          con.rollback();
        }
        con.setAutoCommit(true);
      } catch (SQLException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
        throw new DBException(e.getMessage());
      }
    } else {
      return false;
    }
    return true;
View Full Code Here

        }
        con.setAutoCommit(true);
      } catch (SQLException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
        throw new DBException(e.getMessage());
      }

    } else {
      return false;
    }
View Full Code Here

        stockPrice = rs.getFloat("price");
      }
      pStmt.close();
    } catch (SQLException ex) {
      ex.printStackTrace();
      throw new DBException(ex.getMessage());
    }

    return stockPrice;
  }
View Full Code Here

      pStmt.setString(2, userId);
      status = pStmt.executeUpdate();
      pStmt.close();
    } catch (SQLException ex) {
      ex.printStackTrace();
      throw new DBException(ex.getMessage());
    }
    if (status == 0) {
      return false;
    } else {
      return true;
View Full Code Here

      pStmt.setInt(1, 0);
      pStmt.executeUpdate();
      pStmt.close();
    } catch (SQLException ex) {
      ex.printStackTrace();
      throw new DBException(ex.getMessage());
    }
    if (status == 0) {
      return false;
    } else {
      return true;
View Full Code Here

      pStmt.setString(1, userId);
      status = pStmt.executeUpdate();
      pStmt.close();
    } catch (SQLException ex) {
      ex.printStackTrace();
      throw new DBException(ex.getMessage());
    }
    if (status == 0) {
      return false;
    } else {
      return true;
View Full Code Here

TOP

Related Classes of com.dev.trade.exception.DBException

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.