[
https://issues.apache.org/jira/browse/CB-3010?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13628788#comment-13628788
]
Parmod Kumar commented on CB-3010:
----------------------------------
In Cordova2.6 we are also not able to get data from prepopulated table. We are
copying our database file to the location (/data/data/packagename/app_database/
).From DDMS we are also able to see our database file but when we query the
database it show exception "No such table" found.
Can you please guide me how can we get the prepopulated data in cordova2.6 and
it is occuring only for Android(4.0+).
Exception logs are:-
04-11 14:49:11.570: E/SQLiteLog(6472): (1) no such table: tblProduct
04-11 14:49:11.570: W/System.err(6472):
android.database.sqlite.SQLiteException: no such table: tblProduct (code 1): ,
while compiling: SELECT * FROM tblProduct
04-11 14:49:11.575: W/System.err(6472): at
android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
04-11 14:49:11.575: W/System.err(6472): at
android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:1012)
04-11 14:49:11.575: W/System.err(6472): at
android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:623)
04-11 14:49:11.575: W/System.err(6472): at
android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:588)
04-11 14:49:11.575: W/System.err(6472): at
android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:58)
04-11 14:49:11.575: W/System.err(6472): at
android.database.sqlite.SQLiteQuery.<init>(SQLiteQuery.java:37)
04-11 14:49:11.575: W/System.err(6472): at
android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:44)
04-11 14:49:11.575: W/System.err(6472): at
android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1314)
04-11 14:49:11.575: W/System.err(6472): at
android.database.sqlite.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1253)
04-11 14:49:11.575: W/System.err(6472): at
org.apache.cordova.Storage.executeSql(Storage.java:173)
04-11 14:49:11.575: W/System.err(6472): at
org.apache.cordova.Storage.execute(Storage.java:83)
04-11 14:49:11.575: W/System.err(6472): at
org.apache.cordova.api.CordovaPlugin.execute(CordovaPlugin.java:66)
04-11 14:49:11.575: W/System.err(6472): at
org.apache.cordova.api.PluginManager.exec(PluginManager.java:224)
04-11 14:49:11.575: W/System.err(6472): at
org.apache.cordova.ExposedJsApi.exec(ExposedJsApi.java:44)
04-11 14:49:11.575: W/System.err(6472): at
android.webkit.WebViewCore.nativeMouseClick(Native Method)
04-11 14:49:11.575: W/System.err(6472): at
android.webkit.WebViewCore.nativeMouseClick(Native Method)
04-11 14:49:11.575: W/System.err(6472): at
android.webkit.WebViewCore.access$13100(WebViewCore.java:76)
04-11 14:49:11.575: W/System.err(6472): at
android.webkit.WebViewCore$EventHub.dispatchWebKitEvent(WebViewCore.java:2898)
04-11 14:49:11.575: W/System.err(6472): at
android.webkit.WebViewInputDispatcher.dispatchWebKitEvent(WebViewInputDispatcher.java:767)
04-11 14:49:11.575: W/System.err(6472): at
android.webkit.WebViewInputDispatcher.dispatchWebKitEvents(WebViewInputDispatcher.java:689)
04-11 14:49:11.575: W/System.err(6472): at
android.webkit.WebViewInputDispatcher.access$800(WebViewInputDispatcher.java:78)
04-11 14:49:11.575: W/System.err(6472): at
android.webkit.WebViewInputDispatcher$WebKitHandler.handleMessage(WebViewInputDispatcher.java:1257)
04-11 14:49:11.575: W/System.err(6472): at
android.os.Handler.dispatchMessage(Handler.java:99)
04-11 14:49:11.580: W/System.err(6472): at
android.os.Looper.loop(Looper.java:137)
04-11 14:49:11.580: W/System.err(6472): at
android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:1066)
04-11 14:49:11.580: W/System.err(6472): at
java.lang.Thread.run(Thread.java:856)
04-11 14:49:11.580: I/System.out(6472): Storage.executeSql(): Error=no such
table: tblProduct (code 1): , while compiling: SELECT * FROM tblProduct
> Unable to get data from prepoulated database table.(Select Query not working.)
> ------------------------------------------------------------------------------
>
> Key: CB-3010
> URL: https://issues.apache.org/jira/browse/CB-3010
> Project: Apache Cordova
> Issue Type: Bug
> Components: Android
> Affects Versions: 2.6.0
> Environment: Andriod(Only test on android no idea for IOS)
> Reporter: Parmod Kumar
>
> When we are querying on the prepoulate database it shows an error of no such
> table. While we can see that all the tables are present in database. If we
> create a new table at run time it will create the table in parallel to the
> tables which are in our prepopulated database. Bute we are unable to get
> reult from the prepopulated tables.
> While testing we also found that select query is not working.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira