Package com.blogger.tcuri.appserver.db

Examples of com.blogger.tcuri.appserver.db.SqlBuilder


    public Resolution execute(ActionContext context) throws Exception {

        String content = context.param("content");

        if (Utils.isNotBlank(content)) {
            SqlBuilder sql = new SqlBuilder(
                    "insert into messages (content) values (?)", content);
            DbUtils.execute(sql);
        }

        return CrudLogic.read();
View Full Code Here


    public Resolution execute(ActionContext context) throws Exception {

        String id = context.param("id");

        if (Utils.isNotBlank(id)) {
            SqlBuilder sql = new SqlBuilder(
                    "delete from messages where id=?", id);
            DbUtils.execute(sql);
        }

        return CrudLogic.read();
View Full Code Here

        String id = context.param("id");
        String content = context.param("content");

        if (Utils.isNotBlank(id) && Utils.isNotBlank(content)) {
            SqlBuilder sql = new SqlBuilder(
                    "update messages set content=? where id=?", content, id);
            DbUtils.execute(sql);
        }

        return CrudLogic.read();
View Full Code Here

import com.blogger.tcuri.appserver.resolution.Resolution;

public class CrudLogic {

    public static Resolution read() throws SQLException {
        SqlBuilder sql = new SqlBuilder(
                "select id,content,formatdatetime(updatetime, 'yyyy-MM-dd HH:mm:ss') as updatetime from messages order by id desc");

        List<Map<String, Object>> messageList = DbUtils.selectList(sql,
                MapHandler.INSTANCE);
View Full Code Here

TOP

Related Classes of com.blogger.tcuri.appserver.db.SqlBuilder

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.