android Sqlite持久层框架 ORMLite日志 在Eclipse中输出
这个框架功能相当强大,今天再看官网文档时,发现支持复杂SQL语句,可定义返回对象数组,强大的很还有待进一步研究。
上一次没有解决此框架下在 Eclipse ADT中logCat输出查询日志的问题,官方已说明,默认是没有打开的,只是把创建表的语句打印出来了,这一点确实,于是今天 再试了下 log4j的配置,仍然不行,再看官方文档:
4.3 Android Logging
The ormlite-android.jar classes define the AndroidLog class which is the Android specific version of ORMLite logging. This class makes calls to the Log.d, Log.i, … methods in the Android API. To see the log output, you will need to use the adb utility to view the log output:
adb logcat
Since INFO is the default under Android, only message such as the following will be spit out by default:
I/TableUtils( 254): creating table 'simpledata'
I/TableUtils( 254): creating index 'simpledata_string_idx' for table
'simpledata
I/TableUtils( 254): executed create table statement changed 1 rows:
CREATE TABLE `simpledata` (`date` VARCHAR, `id` INTEGER PRIMARY
KEY AUTOINCREMENT , `even` SMALLINT )
I/TableUtils( 254): executed create table statement changed 1 rows:
CREATE INDEX `simpledata_string_idx` ON `simpledata` ( `string` )
To enable more debug information you will want to do something like the following to turn on logging for a particular class:
adb shell setprop log.tag.StatementExecutor VERBOSE
adb shell setprop log.tag.BaseMappedStatement VERBOSE
adb shell setprop log.tag.MappedCreate VERBOSE
This enables messages such as:
D/BaseMappedStatement( 465): create object using 'INSERT INTO `simpledata`
(`date` ,`string` ,`millis` ,`even` ) VALUES (?,?,?,?)' and 4 args,
changed 1 rows
D/BaseMappedStatement( 465): assigned id '9' from keyholder to 'id' in
SimpleData object
To enable all debug messages for all ORMLite classes then use the following:
adb shell setprop log.tag.ORMLite DEBUG
还是EN文不是很好的原因,按照说明,运行Eclipse的同时,我打开了adb 控制台,在里面执行上面这一句,搞定.
上面就是我想要的程序运行过程中打印所有SQL语句的内容。
方便调试
- 大小: 78.2 KB
分享到:
相关推荐
Google开源的基于Android的Sqlite对象关系映射框架 ormlite 压缩包里包含 ormlite-android-4.30.jar 及帮助文档、ormlite-core-4.30.jar核心包 当然也支持在Java中的Jdbc中使用类似Hibernate Sqlite驱动包、ormlite...
一个简单的Android SQLite ORM框架不想花资源分的同学可以上我的github主页下载:https://github.com/chenyihan/Simple-SQLite-ORM-Android,因为要传到github,所以代码中的注释和doc文档都是英文的,对自己英文不...
greenDAO是一个可以帮助Android开发者快速将Java对象映射到SQLite数据库的表单中的ORM解决方案,通过使用一个简单的面向对象API,开发者可以对Java对象进行存储、更新、删除和查询。
该案例对android的数据日常操作进行了整合,使用了Java注解和反射机制实现sql语句的封装,大大简化了对数据库的增删改查操作。
sqlite orm android java
asorm1.0beta android Sqlite3 ORM 框架; 一个安卓上面的数据sql与对象之间的映射框架; 支持自动事务,自动创建表;不支持外键,存储过程;
asorm android Sqlite3 ORM 框架; 一个安卓上面的数据sql与对象之间的映射框架; 支持自动事务,自动创建表;不支持外键,存储过程;
Android 数据库SQLite 详解,简单学好SQLite
Android中使用ormlite实现持久化,有外键等使用示例。
android开源的orm框架,使用起来很简单。避开了直接操作sqlite,只需关注java实体对象。一句代码解决CRUD。
SQLite 持久性框架 SQPersist ,SQPersist 是 Objective-C 封装 SQLite 的持久性框架。
它是一个零配置的数据库,这意味着与其他数据库不一样,您不需要在系统中配置。 就像其他数据库,SQLite 引擎不是一个独立的进程,可以按应用程序需求进行静态或动态连接。SQLite 直接访问其存储文件。 为什么要用 ...
LiteSQL 是一个C++的数据库持久层框架,支持 SQLite3、MySQL和PostgreSQL数据库。
android sqlite可视化工具,可以导入新建数据这个数据库里
引用:“OrmLite提供了一些轻量级持久化Java对象到SQL数据库,同时也避免了复杂性和更多的标准的ORM包的开销功能。它支持的SQL数据库使用JDBC的数量,还支持原生的Android操作系统数据库API调用sqlite。” 使用方法...
Android sqlite数据库操作通用框架AHibernate 使用示例见博客: http://blog.csdn.net/lk_blog
android sqlite的使用方法
sqlite-android一个Android SQLite支持库
android之SQLite数据库开发详解: Android 开发中使用 SQLite 数据库 简介: SQLite 是一款非常流行的嵌入式数据库,它支持 SQL 查询,并且只用很少的内存。...本文主要讲解 SQLite 在 Android 环境中的基本使用。
android sqlite示例代码