当前位置: 首页>>代码示例>>Java>>正文


Java Yank.execute方法代码示例

本文整理汇总了Java中org.knowm.yank.Yank.execute方法的典型用法代码示例。如果您正苦于以下问题:Java Yank.execute方法的具体用法?Java Yank.execute怎么用?Java Yank.execute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.knowm.yank.Yank的用法示例。


在下文中一共展示了Yank.execute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getUserData

import org.knowm.yank.Yank; //导入方法依赖的package包/类
public DbUser getUserData(IUser user){
    if(Karren.conf.getAllowSQLRW()) {
        if(!dbUserCache.containsKey(user.getStringID())) {
            String sql = "INSERT IGNORE User (UserID, TimeLeft) VALUES (?, null)";
            Object[] params = {user.getLongID()};
            Yank.execute(sql, params);
            sql = "SELECT * FROM User WHERE UserID=?";
            Object[] params2 = {user.getLongID()};
            DbUser dbUser = Yank.queryBean(sql, DbUser.class, params2);
            dbUserCache.put(user.getStringID(), dbUser);
            return dbUser;
        } else {
            return dbUserCache.get(user.getStringID());
        }
    }
    return null;
}
 
开发者ID:ripxfrostbite,项目名称:karren-sama,代码行数:18,代码来源:MySQLInterface.java

示例2: getGuild

import org.knowm.yank.Yank; //导入方法依赖的package包/类
public DbGuild getGuild(IGuild guild){
    if(Karren.conf.getAllowSQLRW()){
        if(!dbGuildCache.containsKey(guild.getStringID())) {
            String sql = "INSERT IGNORE Guild (GuildID, GuildOwner, GuildName, CommandPrefix, RollDifficulty, MaxVolume, RandomRange, OverrideChannel) VALUES (?, ?, ?, null, -1, 40, 0, 0)";
            Object[] params = {guild.getStringID(), guild.getOwner().getName(), guild.getName()};
            Yank.execute(sql, params);
            sql = "SELECT * FROM Guild WHERE GuildID=?";
            Object[] params2 = {guild.getStringID()};
            DbGuild dbGuild = Yank.queryBean(sql, DbGuild.class, params2);
            dbGuildCache.put(guild.getStringID(), dbGuild);
            return dbGuild;
        } else {
            return dbGuildCache.get(guild.getStringID());
        }
    }
    return null;
}
 
开发者ID:ripxfrostbite,项目名称:karren-sama,代码行数:18,代码来源:MySQLInterface.java

示例3: getWordCount

import org.knowm.yank.Yank; //导入方法依赖的package包/类
public DbWordcount getWordCount(String word){
    if(Karren.conf.getAllowSQLRW()) {
        if(!dbWordcountCache.containsKey(word)) {
            String sql = "INSERT IGNORE WordCounts (WordID, Word, Count, CountStarted) VALUES (null, ?, 1, null)";
            Object[] params = {word};
            Yank.execute(sql, params);
            sql = "SELECT * FROM WordCounts WHERE Word=?";
            DbWordcount dbWordcount = Yank.queryBean(sql, DbWordcount.class, params);
            dbWordcountCache.put(word, dbWordcount);
            return dbWordcount;
        } else {
            return dbWordcountCache.get(word);
        }
    }
    return null;
}
 
开发者ID:ripxfrostbite,项目名称:karren-sama,代码行数:17,代码来源:MySQLInterface.java

示例4: doCreateItemsTableIfNot

import org.knowm.yank.Yank; //导入方法依赖的package包/类
@Override
public ItemsVO doCreateItemsTableIfNot(ItemsVO vo) {
    // boolean tableExists = Yank.queryScalar(SQL_IF_TABLE_EXISTS.replace("#searchTable#",
    // vo.getItemsManageTable().toUpperCase()), String.class, null) == null;
    boolean tableExists = doIfTableExists(vo);
    if (!tableExists) {
        String sql = StringUtilsExt.replaceArrayMerge(SQL_CREATE_ITEMS_TABLE_IF_NOT,
                new String[] { "#itemsManageTable#", "#colname#", "#coltype#" },
                new String[] { vo.getItemsManageTable().toUpperCase(), vo.getColname(), vo.getColtype() });
        logger.debug("JDBC::doCreateItemsTableIfNot tableExists={} therefore sql={}", tableExists, sql);
        Yank.execute(sql, null);
    } else {
        logger.debug("JDBC::doCreateItemsTableIfNot tableExists={}, did not CREATE TABLE", tableExists);
    }
    return vo;
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:17,代码来源:JdbcDerbyDAO.java

示例5: doStoreItemValue

import org.knowm.yank.Yank; //导入方法依赖的package包/类
/*************
 * ITEM DAOs *
 *************/
@Override
public void doStoreItemValue(Item item, ItemVO vo) {
    vo = storeItemValueProvider(item, vo);
    String sql = StringUtilsExt.replaceArrayMerge(SQL_INSERT_ITEM_VALUE,
            new String[] { "#tableName#", "#dbType#", "#tablePrimaryValue#" },
            new String[] { vo.getTableName(), vo.getDbType(), sqlTypes.get("tablePrimaryValue") });
    Object[] params = new Object[] { vo.getValue() };
    logger.debug("JDBC::doStoreItemValue sql={} value='{}'", sql, vo.getValue());
    Yank.execute(sql, params);
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:14,代码来源:JdbcH2DAO.java

示例6: doStoreItemValue

import org.knowm.yank.Yank; //导入方法依赖的package包/类
public void doStoreItemValue(Item item, ItemVO vo) {
    vo = storeItemValueProvider(item, vo);
    String sql = StringUtilsExt.replaceArrayMerge(SQL_INSERT_ITEM_VALUE,
            new String[] { "#tableName#", "#tablePrimaryValue#" },
            new String[] { vo.getTableName(), sqlTypes.get("tablePrimaryValue") });
    Object[] params = new Object[] { vo.getValue(), vo.getValue() };
    logger.debug("JDBC::doStoreItemValue sql={} value='{}'", sql, vo.getValue());
    Yank.execute(sql, params);
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:10,代码来源:JdbcBaseDAO.java

示例7: doCreateItemsTableIfNot

import org.knowm.yank.Yank; //导入方法依赖的package包/类
@Override
public ItemsVO doCreateItemsTableIfNot(ItemsVO vo) {
    String sql = StringUtilsExt.replaceArrayMerge(SQL_CREATE_ITEMS_TABLE_IF_NOT,
            new String[] { "#itemsManageTable#", "#colname#", "#coltype#" },
            new String[] { vo.getItemsManageTable(), vo.getColname(), vo.getColtype() });
    logger.debug("JDBC::doCreateItemsTableIfNot sql={}", sql);
    Yank.execute(sql, null);
    return vo;
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:10,代码来源:JdbcSqliteDAO.java

示例8: doCreateItemsTableIfNot

import org.knowm.yank.Yank; //导入方法依赖的package包/类
@Override
public ItemsVO doCreateItemsTableIfNot(ItemsVO vo) {
    String sql = StringUtilsExt.replaceArrayMerge(SQL_CREATE_ITEMS_TABLE_IF_NOT,
            new String[] { "#itemsManageTable#", "#colname#", "#coltype#", "#itemsManageTable#" },
            new String[] { vo.getItemsManageTable(), vo.getColname(), vo.getColtype(), vo.getItemsManageTable() });
    logger.debug("JDBC::doCreateItemsTableIfNot sql={}", sql);
    Yank.execute(sql, null);
    return vo;
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:10,代码来源:JdbcHsqldbDAO.java

示例9: doStoreItemValue

import org.knowm.yank.Yank; //导入方法依赖的package包/类
/*************
 * ITEM DAOs *
 *************/
@Override
public void doStoreItemValue(Item item, ItemVO vo) {
    vo = storeItemValueProvider(item, vo);
    String sql = StringUtilsExt.replaceArrayMerge(SQL_INSERT_ITEM_VALUE,
            new String[] { "#tableName#", "#dbType#", "#tableName#", "#tablePrimaryValue#" }, new String[] {
                    vo.getTableName(), vo.getDbType(), vo.getTableName(), sqlTypes.get("tablePrimaryValue") });
    Object[] params = new Object[] { vo.getValue() };
    logger.debug("JDBC::doStoreItemValue sql={} value='{}'", sql, vo.getValue());
    Yank.execute(sql, params);
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:14,代码来源:JdbcHsqldbDAO.java

示例10: doCreateItemTable

import org.knowm.yank.Yank; //导入方法依赖的package包/类
/*************
 * ITEM DAOs *
 *************/
@Override
public void doCreateItemTable(ItemVO vo) {
    String sql = StringUtilsExt.replaceArrayMerge(SQL_CREATE_ITEM_TABLE,
            new String[] { "#tableName#", "#dbType#", "#tablePrimaryKey#" },
            new String[] { vo.getTableName(), vo.getDbType(), sqlTypes.get("tablePrimaryKey") });
    Yank.execute(sql, null);
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:11,代码来源:JdbcDerbyDAO.java

示例11: doStoreItemValue

import org.knowm.yank.Yank; //导入方法依赖的package包/类
@Override
public void doStoreItemValue(Item item, ItemVO vo) {
    vo = storeItemValueProvider(item, vo);
    String sql = StringUtilsExt.replaceArrayMerge(SQL_INSERT_ITEM_VALUE,
            new String[] { "#tableName#", "#dbType#", "#tablePrimaryValue#" },
            new String[] { vo.getTableName().toUpperCase(), vo.getDbType(), sqlTypes.get("tablePrimaryValue") });
    Object[] params = new Object[] { vo.getValue() };
    logger.debug("JDBC::doStoreItemValue sql={} value='{}'", sql, vo.getValue());
    Yank.execute(sql, params);
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:11,代码来源:JdbcDerbyDAO.java

示例12: doDeleteItemsEntry

import org.knowm.yank.Yank; //导入方法依赖的package包/类
public void doDeleteItemsEntry(ItemsVO vo) {
    String sql = StringUtilsExt.replaceArrayMerge(SQL_DELETE_ITEMS_ENTRY, new String[] { "#itemname#" },
            new String[] { vo.getItemname() });
    logger.debug("JDBC::doDeleteItemsEntry sql={}", sql);
    Yank.execute(sql, null);
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:7,代码来源:JdbcBaseDAO.java

示例13: doUpdateItemTableNames

import org.knowm.yank.Yank; //导入方法依赖的package包/类
/*************
 * ITEM DAOs *
 *************/
public void doUpdateItemTableNames(List<ItemVO> vol) {
    String sql = updateItemTableNamesProvider(vol);
    Yank.execute(sql, null);
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:8,代码来源:JdbcBaseDAO.java

示例14: update

import org.knowm.yank.Yank; //导入方法依赖的package包/类
public void update(){
    String sql = "UPDATE Reminder SET ReminderSent=? WHERE ReminderID=?";
    Yank.execute(sql, new Object[]{reminderSent, reminderID});
}
 
开发者ID:ripxfrostbite,项目名称:karren-sama,代码行数:5,代码来源:DbReminder.java

示例15: update

import org.knowm.yank.Yank; //导入方法依赖的package包/类
public void update(){
    if(!notMapped) {
        String sql = "UPDATE GuildUser SET RollTimeout=?, IgnoreCommands=?, RollsSinceLastClear=?, TotalRolls=?, WinningRolls=? WHERE GuildUserID=?";
        Yank.execute(sql, new Object[]{rollTimeout, ignoreCommands, rollsSinceLastClear, totalRolls, winningRolls, guildUserID});
    }
}
 
开发者ID:ripxfrostbite,项目名称:karren-sama,代码行数:7,代码来源:DbGuildUser.java


注:本文中的org.knowm.yank.Yank.execute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。