Package org.fto.jthink.jdbc

Examples of org.fto.jthink.jdbc.SQL


    }
    try{
      transaction.begin();
     
      /* 构建SQL语句 */
      SQL sql = sqlBuilder.constructSQLForCount("Messages", "*", "ROW_COUNT", null);
      DataObject countDO = (DataObject)((List)sqlExecutor.execute(sql)).iterator().next();
      return Integer.parseInt(countDO.get("ROW_COUNT"));
     
    }finally{
      transaction.close();
View Full Code Here


  public List searchMessages() throws Exception{
    try{
      transactionManager.begin();
     
      /* 构建SQL语句 */
      SQL sql = sqlBuilder.constructSQLForSelect("Messages", false, null, null, "", "SendTime desc", (getPageOffset()-1)*getPageRows(), getPageRows());
      /* 执行SQL语句,并返回结果 */
      return (List)sqlExecutor.execute(sql);
     
     
    }finally{
View Full Code Here

    }
    try{
      transactionManager.begin();
     
      /* 构建SQL语句 */
      SQL sql = sqlBuilder.constructSQLForCount("Messages", "*", "ROW_COUNT", null);
     
      Element countEL = (Element)((List)sqlExecutor.execute(sql)).iterator().next();
     
      return Integer.parseInt(countEL.getAttributeValue("ROW_COUNT"));
     
View Full Code Here

      putToHashMap(msgsHM, "Contact", request.getParameter("Contact"));
     
      msgsHM.put("IP", request.getServletRequest().getRemoteAddr());
      msgsHM.put("SendTime", DateTimeHelper.formatDateTimetoString(DateTimeHelper.getSystemDate()));
     
      SQL sql = sqlBuilder.constructSQLForInsert("Messages", msgsHM);
     
      /* 执行SQL语句 */
      sqlExecutor.execute(sql);
     
      /* 提交事务 */
 
View Full Code Here

      sqlStr.append(" DISTINCT ");
    }
   
    /* 生成返回列的串 */
    if (columns != null && columns.length != 0) {
      SQL columnSQL = constructSelectedColumn(columns);
      sqlStr.append(columnSQL.getSQLStatement());
      values = columnSQL.getValueBuffered();
    }else{
      sqlStr.append("*");
    }

    /* 生成FROM子串, 如果tableName为空,将不构建FROM子句 */
    if (tableName != null && tableName.length() != 0) {
      sqlStr.append(" FROM ").append(tableName);
    }
   
    /* 生成查询条件串 */
    if (condition != null && condition.size() != 0) {
      sqlStr.append(" WHERE ").append(condition.getConditionStatement());
      ObjectBuffered objBuff = condition.getValueBuffered();
      if(values!=null){
        values.append(objBuff);
      }else{
        values = objBuff;
      }
    }
   
    /* 生成GROUP BY串 */
    if (groupby != null && groupby.length() != 0) {
      sqlStr.append(" GROUP BY ").append(groupby);
    }
   
    /* 生成ORDER BY串 */
    if (orderby != null && orderby.length() != 0) {
      sqlStr.append(" ORDER BY ").append(orderby);
    }
   
    return new SQL(SQL.SELECT, sqlStr, values, startIndex, rowLen);
  }
View Full Code Here

TOP

Related Classes of org.fto.jthink.jdbc.SQL

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.