草庐IT

SQLite-PCL

全部标签

android - Sqlite如何使用游标获取字符串项

publicCursorgetImages(longrowId)throwsSQLException{CursormCursor=db.rawQuery("select*fromPicturesWHEREid="+rowId+";",null);if(mCursor!=null){mCursor.moveToFirst();}returnmCursor;}表格列“id,pic,comment”我想将图片和评论的值取到字符串数组中。我的代码是:inti=0;Cursorc1=db.getImages(memberId);c1.moveToFirst();while(c1.isLast()

android - Sqlite如何使用游标获取字符串项

publicCursorgetImages(longrowId)throwsSQLException{CursormCursor=db.rawQuery("select*fromPicturesWHEREid="+rowId+";",null);if(mCursor!=null){mCursor.moveToFirst();}returnmCursor;}表格列“id,pic,comment”我想将图片和评论的值取到字符串数组中。我的代码是:inti=0;Cursorc1=db.getImages(memberId);c1.moveToFirst();while(c1.isLast()

android - 检查sqlite数据库在android中是打开还是关闭

我的DBDriver中有两种方法类别为open和closesqlitedatabase如下所示。privateSQLiteDatabasedatabase;/***OpenDatabasetoreadandwrite.**@throwsSQLException*/publicvoidopen()throwsSQLException{database=dbHelper.getWritableDatabase();}/***Closeopeneddatabase.*/publicvoidclose(){dbHelper.close();}我在其他类中使用上述方法打开和关闭sqlitedat

android - 检查sqlite数据库在android中是打开还是关闭

我的DBDriver中有两种方法类别为open和closesqlitedatabase如下所示。privateSQLiteDatabasedatabase;/***OpenDatabasetoreadandwrite.**@throwsSQLException*/publicvoidopen()throwsSQLException{database=dbHelper.getWritableDatabase();}/***Closeopeneddatabase.*/publicvoidclose(){dbHelper.close();}我在其他类中使用上述方法打开和关闭sqlitedat

c# - sqlite-net的通用方法

我想做一个简单的存储库,下面是我用过的方法:publicstaticListGetAll(){return_dbConnection.Table().ToList();}但是我遇到了一个错误:'T'mustbeanon-abstracttypewithapublicparameterlessconstructorinordertouseitasparameter'T'inthegenerictypeormethod'SQLite.SQLiteConnection.Table()'我使用SQLitewrappersqlite-net.当然,我的类(class)是通用的:classFeed

c# - sqlite-net的通用方法

我想做一个简单的存储库,下面是我用过的方法:publicstaticListGetAll(){return_dbConnection.Table().ToList();}但是我遇到了一个错误:'T'mustbeanon-abstracttypewithapublicparameterlessconstructorinordertouseitasparameter'T'inthegenerictypeormethod'SQLite.SQLiteConnection.Table()'我使用SQLitewrappersqlite-net.当然,我的类(class)是通用的:classFeed

java - 返回变量中的记录数,Sqlite,Android,Java

我的最终目标是限制能够创建的记录,以便我可以拥有我的应用程序的试用版。我想我可以通过在sqlitecount语句中返回一个int变量,并使用一个简单的IF语句来确定是否应该创建一个新记录来简单地做到这一点。我这样调用:intjcount=0;mDbHelper.countjournals(jcount);现在我正在尝试执行这个publicintcountjournals(intjcount){mDb.execSQL(jcount+"=SELECTCOUNT(*)FROM"+DATABASE_JOURNAL_TABLE);returnjcount;}我收到的错误:08-2722:42:3

java - 返回变量中的记录数,Sqlite,Android,Java

我的最终目标是限制能够创建的记录,以便我可以拥有我的应用程序的试用版。我想我可以通过在sqlitecount语句中返回一个int变量,并使用一个简单的IF语句来确定是否应该创建一个新记录来简单地做到这一点。我这样调用:intjcount=0;mDbHelper.countjournals(jcount);现在我正在尝试执行这个publicintcountjournals(intjcount){mDb.execSQL(jcount+"=SELECTCOUNT(*)FROM"+DATABASE_JOURNAL_TABLE);returnjcount;}我收到的错误:08-2722:42:3

android - 从android中的sqlite获取空整数

我遇到的问题实际上可能是设计问题,但我正在努力寻找解决方法。在我的android应用程序的sqlite数据库中,我有一个名为Customer的表。这有大约40列各种字符串和int数据类型。实际上,这些列中的任何一个都可能为空,也可能不为空。在我的代码中,我有一个名为getCustomer()的函数,它查询数据库中的特定客户,并将数据库中的所有单元格放入Customer类,其中包含每列的变量。然后我可以按我的意愿传递那个客户对象。getCustomer()函数返回此Customer对象。我的问题是整数可能为空。我熟悉int在java中如何不能为null,但是Integer如何可以为nul

android - 从android中的sqlite获取空整数

我遇到的问题实际上可能是设计问题,但我正在努力寻找解决方法。在我的android应用程序的sqlite数据库中,我有一个名为Customer的表。这有大约40列各种字符串和int数据类型。实际上,这些列中的任何一个都可能为空,也可能不为空。在我的代码中,我有一个名为getCustomer()的函数,它查询数据库中的特定客户,并将数据库中的所有单元格放入Customer类,其中包含每列的变量。然后我可以按我的意愿传递那个客户对象。getCustomer()函数返回此Customer对象。我的问题是整数可能为空。我熟悉int在java中如何不能为null,但是Integer如何可以为nul