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


Java Database.execSQL方法代码示例

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


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

示例1: createTable

import org.greenrobot.greendao.database.Database; //导入方法依赖的package包/类
/** Creates the underlying database table. */
public static void createTable(Database db, boolean ifNotExists) {
    String constraint = ifNotExists? "IF NOT EXISTS ": "";
    db.execSQL("CREATE TABLE " + constraint + "\"VIDEO_BEAN\" (" + //
            "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id
            "\"DATA_TYPE\" TEXT," + // 1: dataType
            "\"TITLE\" TEXT," + // 2: title
            "\"TEXT\" TEXT," + // 3: text
            "\"DESCRIPTION\" TEXT," + // 4: description
            "\"IMAGE\" TEXT," + // 5: image
            "\"ACTION_URL\" TEXT," + // 6: actionUrl
            "\"SHADE\" INTEGER NOT NULL ," + // 7: shade
            "\"PLAY_URL\" TEXT," + // 8: playUrl
            "\"CATEGORY\" TEXT," + // 9: category
            "\"DURATION\" INTEGER NOT NULL ," + // 10: duration
            "\"ICON\" TEXT);"); // 11: icon
}
 
开发者ID:popo1379,项目名称:popomusic,代码行数:18,代码来源:VideoBeanDao.java

示例2: createTable

import org.greenrobot.greendao.database.Database; //导入方法依赖的package包/类
/** Creates the underlying database table. */
public static void createTable(Database db, boolean ifNotExists) {
    String constraint = ifNotExists? "IF NOT EXISTS ": "";
    db.execSQL("CREATE TABLE " + constraint + "\"ABCDEF_ENTITY\" (" + //
            "\"_id\" INTEGER PRIMARY KEY ," + // 0: id
            "\"A\" INTEGER," + // 1: a
            "\"B\" INTEGER," + // 2: b
            "\"C\" INTEGER," + // 3: c
            "\"D\" INTEGER," + // 4: d
            "\"E\" INTEGER," + // 5: e
            "\"F\" INTEGER," + // 6: f
            "\"G\" INTEGER," + // 7: g
            "\"H\" INTEGER," + // 8: h
            "\"J\" INTEGER," + // 9: j
            "\"I\" INTEGER," + // 10: i
            "\"K\" INTEGER);"); // 11: k
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:18,代码来源:AbcdefEntityDao.java

示例3: createTable

import org.greenrobot.greendao.database.Database; //导入方法依赖的package包/类
/** Creates the underlying database table. */
public static void createTable(Database db, boolean ifNotExists) {
    String constraint = ifNotExists? "IF NOT EXISTS ": "";
    db.execSQL("CREATE TABLE " + constraint + "\"TO_MANY_TARGET2\" (" + //
            "\"_id\" INTEGER PRIMARY KEY ," + // 0: id
            "\"FK_ID\" INTEGER);"); // 1: fkId
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:8,代码来源:ToManyTarget2Dao.java

示例4: createTable

import org.greenrobot.greendao.database.Database; //导入方法依赖的package包/类
/** Creates the underlying database table. */
public static void createTable(Database db, boolean ifNotExists) {
    String constraint = ifNotExists? "IF NOT EXISTS ": "";
    db.execSQL("CREATE TABLE " + constraint + "\"USER\" (" + //
            "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id
            "\"NAME\" TEXT," + // 1: name
            "\"AGE\" INTEGER NOT NULL );"); // 2: age
}
 
开发者ID:InnoFang,项目名称:Android-Code-Demos,代码行数:9,代码来源:UserDao.java

示例5: createTable

import org.greenrobot.greendao.database.Database; //导入方法依赖的package包/类
/** Creates the underlying database table. */
public static void createTable(Database db, boolean ifNotExists) {
    String constraint = ifNotExists? "IF NOT EXISTS ": "";
    db.execSQL("CREATE TABLE " + constraint + "\"GREEN_TEST\" (" + //
            "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id
            "\"NAME\" TEXT," + // 1: name
            "\"PASSWORD\" TEXT," + // 2: password
            "\"COMMENT\" TEXT);"); // 3: comment
}
 
开发者ID:yzzslow0,项目名称:Ec2m,代码行数:10,代码来源:GreenTestDao.java

示例6: createTable

import org.greenrobot.greendao.database.Database; //导入方法依赖的package包/类
/** Creates the underlying database table. */
public static void createTable(Database db, boolean ifNotExists) {
    String constraint = ifNotExists? "IF NOT EXISTS ": "";
    db.execSQL("CREATE TABLE " + constraint + "\"ci\" (" + //
            "\"value\" INTEGER PRIMARY KEY ," + // 0: id
            "\"AUTHOR\" TEXT," + // 1: author
            "\"RHYTHMIC\" TEXT," + // 2: rhythmic
            "\"CONTENT\" TEXT," + // 3: content
            "\"PYQUAN\" TEXT," + // 4: pyquan
            "\"PYQUANY\" TEXT," + // 5: pyquany
            "\"PYJIAN\" TEXT);"); // 6: pyjian
}
 
开发者ID:yippeesoft,项目名称:NotifyTools,代码行数:13,代码来源:SongCiDao.java

示例7: createTable

import org.greenrobot.greendao.database.Database; //导入方法依赖的package包/类
/** Creates the underlying database table. */
public static void createTable(Database db, boolean ifNotExists) {
    String constraint = ifNotExists? "IF NOT EXISTS ": "";
    db.execSQL("CREATE TABLE " + constraint + "\"USER\" (" + //
            "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id
            "\"USER_NAME\" TEXT);"); // 1: userName
}
 
开发者ID:devzwy,项目名称:NeiHanDuanZiTV,代码行数:8,代码来源:UserDao.java

示例8: updateCollBook

import org.greenrobot.greendao.database.Database; //导入方法依赖的package包/类
private void updateCollBook(Database db) {
    Class<? extends AbstractDao<?, ?>> collBookClass = CollBookBeanDao.class;

    // 遍历查找本地文件,然后修改本地文件的数据
    DaoConfig daoConfig = new DaoConfig(db, collBookClass);
    String tableName = daoConfig.tablename;

    Cursor cursor = db.rawQuery("select _ID,IS_LOCAL from " + tableName, null);
    String id = null;
    String cover = null;
    String isLocal = null;

    StringBuilder updateSb = new StringBuilder();
    while (cursor.moveToNext()) {
        cover = cursor.getString(0);
        id = MD5Utils.strToMd5By16(cover);
        isLocal = cursor.getString(1);

        //如果是本地文件
        if (isLocal.equals("1")) {
            // 数据更新
            updateSb.append("UPDATE " + tableName + " SET ");
            updateSb.append("_ID=").append(String.format(QUOTE, id)).append(DIVIDER);
            updateSb.append("COVER=").append(String.format(QUOTE, cover)).append(" ");
            updateSb.append("WHERE _ID=").append(String.format(QUOTE,cover)).append(";");

            db.execSQL(updateSb.toString());
            updateSb.delete(0, updateSb.length());
        }
    }
}
 
开发者ID:newbiechen1024,项目名称:NovelReader,代码行数:32,代码来源:Update2Helper.java

示例9: createTable

import org.greenrobot.greendao.database.Database; //导入方法依赖的package包/类
/** Creates the underlying database table. */
public static void createTable(Database db, boolean ifNotExists) {
    String constraint = ifNotExists? "IF NOT EXISTS ": "";
    db.execSQL("CREATE TABLE " + constraint + "\"GIRL\" (" + //
            "\"_ID\" TEXT," + // 0: _id
            "\"CREATED_AT\" TEXT," + // 1: createdAt
            "\"desc\" TEXT," + // 2: desc
            "\"publishedAt\" INTEGER," + // 3: publishedAt
            "\"SOURCE\" TEXT," + // 4: source
            "\"TYPE\" TEXT," + // 5: type
            "\"url\" TEXT," + // 6: url
            "\"USED\" INTEGER NOT NULL ," + // 7: used
            "\"WHO\" TEXT);"); // 8: who
}
 
开发者ID:weixianshishen,项目名称:BeautifulGirls,代码行数:15,代码来源:GirlDao.java

示例10: createTable

import org.greenrobot.greendao.database.Database; //导入方法依赖的package包/类
/** Creates the underlying database table. */
public static void createTable(Database db, boolean ifNotExists) {
    String constraint = ifNotExists? "IF NOT EXISTS ": "";
    db.execSQL("CREATE TABLE " + constraint + "\"CITY\" (" + //
            "\"_id\" INTEGER PRIMARY KEY ," + // 0: id
            "\"cityName\" TEXT," + // 1: cityName
            "\"cityCode\" INTEGER NOT NULL ," + // 2: cityCode
            "\"provinceId\" INTEGER NOT NULL );"); // 3: provinceId
}
 
开发者ID:weixianshishen,项目名称:LookWeather,代码行数:10,代码来源:CityDao.java

示例11: createTable

import org.greenrobot.greendao.database.Database; //导入方法依赖的package包/类
/** Creates the underlying database table. */
public static void createTable(Database db, boolean ifNotExists) {
    String constraint = ifNotExists? "IF NOT EXISTS ": "";
    db.execSQL("CREATE TABLE " + constraint + "\"ORDER\" (" + //
            "\"_id\" INTEGER PRIMARY KEY NOT NULL ," + // 0: id
            "\"TYPE\" TEXT," + // 1: type
            "\"TIME\" INTEGER," + // 2: time
            "\"STATUS\" INTEGER NOT NULL ," + // 3: status
            "\"DESC\" TEXT," + // 4: desc
            "\"EARNING\" INTEGER NOT NULL ," + // 5: earning
            "\"MEID\" TEXT," + // 6: meid
            "\"SCENE\" TEXT," + // 7: scene
            "\"PHONE\" TEXT);"); // 8: phone
}
 
开发者ID:ymqq,项目名称:CommonFramework,代码行数:15,代码来源:OrderDao.java

示例12: createTable

import org.greenrobot.greendao.database.Database; //导入方法依赖的package包/类
/** Creates the underlying database table. */
public static void createTable(Database db, boolean ifNotExists) {
    String constraint = ifNotExists? "IF NOT EXISTS ": "";
    db.execSQL("CREATE TABLE " + constraint + "\"PROVINCE\" (" + //
            "\"_id\" INTEGER PRIMARY KEY ," + // 0: id
            "\"PROVINCENAME\" TEXT," + // 1: provinceName
            "\"PROVINCECODE\" INTEGER NOT NULL );"); // 2: provinceCode
}
 
开发者ID:weixianshishen,项目名称:LookWeather,代码行数:9,代码来源:ProvinceDao.java

示例13: dropTable

import org.greenrobot.greendao.database.Database; //导入方法依赖的package包/类
/** Drops the underlying database table. */
public static void dropTable(Database db, boolean ifExists) {
    String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"DATE_ENTITY\"";
    db.execSQL(sql);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:6,代码来源:DateEntityDao.java

示例14: dropTable

import org.greenrobot.greendao.database.Database; //导入方法依赖的package包/类
/** Drops the underlying database table. */
public static void dropTable(Database db, boolean ifExists) {
    String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"GIRL\"";
    db.execSQL(sql);
}
 
开发者ID:weixianshishen,项目名称:BeautifulGirls,代码行数:6,代码来源:GirlDao.java

示例15: dropTable

import org.greenrobot.greendao.database.Database; //导入方法依赖的package包/类
/** Drops the underlying database table. */
public static void dropTable(Database db, boolean ifExists) {
    String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"LIVE_INFO\"";
    db.execSQL(sql);
}
 
开发者ID:jenly1314,项目名称:KingTV,代码行数:6,代码来源:LiveInfoDao.java


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