Oskolok_Lda 1 / 1 / 0 Регистрация: 29.01.2009 Сообщений: 67 |
||||
1 |
||||
25.04.2018, 11:56. Показов 6974. Ответов 69 Метки нет (Все метки)
День добрый!
В чем ошибка? Заранее благодарен.
__________________
1 |
11075 / 7640 / 1179 Регистрация: 21.01.2016 Сообщений: 28,688 |
|
25.04.2018, 11:58 |
2 |
Решение
В чем ошибка? У вас уже есть описание проблемы: «SQL logic error no such table: Otdel». Осталось только разобраться врёт вам коварный и подлый SQLite или вы не к той таблице ломитесь или не тот файл базы данных используете.
0 |
1 / 1 / 0 Регистрация: 29.01.2009 Сообщений: 67 |
|
25.04.2018, 12:16 [ТС] |
3 |
У вас уже есть описание проблемы: «SQL logic error no such table: Otdel». Т.е.? Файл базы данных один, он указан в DataSource. Указанная таблица в этой базе существует и она с данными. Вывод в Combobox сделал по образцу, найденному на форуме. Вот только не работает…
0 |
Usaga 11075 / 7640 / 1179 Регистрация: 21.01.2016 Сообщений: 28,688 |
||||
25.04.2018, 12:24 |
4 |
|||
Oskolok_Lda, значит вы считаете, что SQLite вам врёт? Добавлено через 2 минуты
0 |
1 / 1 / 0 Регистрация: 29.01.2009 Сообщений: 67 |
|
25.04.2018, 12:25 [ТС] |
5 |
что SQLite вам врёт? Я конечно ничего утверждать не буду. Но поскольку в предыдущей программе был один файл с бд .mdf, я его создал заново для SQLite .db. Второму не откуда взяться…
0 |
11075 / 7640 / 1179 Регистрация: 21.01.2016 Сообщений: 28,688 |
|
25.04.2018, 12:28 |
6 |
Oskolok_Lda, SQLite-у вам врать не зачем. Если он говорит, что такой таблицы нет, то её нет.
0 |
1 / 1 / 0 Регистрация: 29.01.2009 Сообщений: 67 |
|
25.04.2018, 12:34 [ТС] |
7 |
Если он говорит, что такой таблицы нет, то её нет. Вот… Миниатюры
0 |
11075 / 7640 / 1179 Регистрация: 21.01.2016 Сообщений: 28,688 |
|
25.04.2018, 12:42 |
8 |
Oskolok_Lda, скриншоты — это очень хорошо, но вы возьмите и скопируйте эту базу в папку с приложением и запустите его. Добавлено через 28 секунд
1 |
1 / 1 / 0 Регистрация: 29.01.2009 Сообщений: 67 |
|
25.04.2018, 12:49 [ТС] |
9 |
Блин… Дико извиняюсь. Я с Visual Studio не давно знаком. Опять забыл поставить копирование файла БД в папку с приложением. Заполнение произошло.
0 |
11075 / 7640 / 1179 Регистрация: 21.01.2016 Сообщений: 28,688 |
|
25.04.2018, 12:52 |
10 |
Oskolok_Lda, всё нормально. Главное, что одолели вашу проблему.
1 |
1 / 1 / 0 Регистрация: 29.01.2009 Сообщений: 67 |
|
25.04.2018, 13:01 [ТС] |
11 |
Спасибо.
0 |
11075 / 7640 / 1179 Регистрация: 21.01.2016 Сообщений: 28,688 |
|
25.04.2018, 13:13 |
12 |
Oskolok_Lda, всё упирается в запрос. Если он правильный, то и данные вы должны получать верные. Подключение вы можете держать открытым, но как это связано с «сразу отображались»?
1 |
1 / 1 / 0 Регистрация: 29.01.2009 Сообщений: 67 |
|
25.04.2018, 13:18 [ТС] |
13 |
всё упирается в запрос. Если он правильный, то и данные вы должны получать верные. С LocalDB у меня все было без запросов. С SQLite, если я правильно понял, нужно сортировки делать только sql-запросами?
Подключение вы можете держать открытым, но как это связано с «сразу отображались»? FORM1 работает с бд в режиме чтения. В Form2 будет происходить редактирование бд, и после ее закрытия данные в Combobox на Form1 должны быть обновлены. Хотя я догадываюсь как это сделать.. Меня больше первый пункт интересует
0 |
11075 / 7640 / 1179 Регистрация: 21.01.2016 Сообщений: 28,688 |
|
25.04.2018, 13:38 |
14 |
Решение
С LocalDB у меня все было без запросов. У вас ничего не могло быть без запросов. LocalDB не силой мысли опрашивается, там такой же SQL как и везде. Другое дело, что вы могли ничего не писать, а воспользоваться каким-нибудь мастером, сгенерировавшим вам эти самые запросы, или ORM-кой. Но это не отменяет того факта, что запросы имели место быть.
FORM1 работает с бд в режиме чтения. В Form2 будет происходить редактирование бд, и после ее закрытия данные в Combobox на Form1 должны быть обновлены. Это на совести вашего приложения. Работа с БД должна идти через общую для всего приложения модель, которая и известит вашу форму о изменении данных.
1 |
1 / 1 / 0 Регистрация: 29.01.2009 Сообщений: 67 |
|
25.04.2018, 13:40 [ТС] |
15 |
Другое дело, что вы могли ничего не писать, а воспользоваться каким-нибудь мастером, сгенерировавшим вам эти самые запросы, или ORM-кой. Понял. Видимо так и было. Буду запросы составлять.
0 |
1 / 1 / 0 Регистрация: 29.01.2009 Сообщений: 67 |
|
25.04.2018, 15:23 [ТС] |
16 |
Не знаю можно так или нет, но все же… Чтобы не создавать новую тему, т.к. вопрос касается данного проекта. Миниатюры
0 |
11075 / 7640 / 1179 Регистрация: 21.01.2016 Сообщений: 28,688 |
|
25.04.2018, 16:31 |
17 |
Oskolok_Lda, ваши таблицы должны содержать первичный ключ (Primary Key), который будет выступать уникальным идентификатором каждой записи в таблице. Пары название_отдела-идентификатор нужно выгрузить в виде массива объектов и «привязать» к DropDownList. При выборе нужного отдела можно использовать его идентификатор для дальнейшей работы.
0 |
1 / 1 / 0 Регистрация: 29.01.2009 Сообщений: 67 |
|
25.04.2018, 16:37 [ТС] |
18 |
содержать первичный ключ (Primary Key) Primary Key создан для каждой таблицы. DropDownList для меня не известное слово ))) Буду искать
0 |
11075 / 7640 / 1179 Регистрация: 21.01.2016 Сообщений: 28,688 |
|
25.04.2018, 16:48 |
19 |
Oskolok_Lda, DropDownList — выпадающий список. К нему можно привязать коллекцию объектов любого класса и в настройках указать, что отображать нужно такое-то свойство, а как выбранное значение использовать другое (DisplayMember, ValueMember). Это то, что вам и нужно. Только как выбранное значение нужно использовать идентификатор записи из базы.
1 |
1 / 1 / 0 Регистрация: 29.01.2009 Сообщений: 67 |
|
25.04.2018, 17:00 [ТС] |
20 |
DisplayMember, ValueMember А как использовать эти параметры? При работе с LocalDB я их использовал. А с SQLite не понимаю как, ведь подключение создается только в момент запуска программы. Или есть возможность использовать TableAdapter, BindingSource для SQLite (Сорри если что-то не правильно называю)?
0 |
Hi All,
I create an Android application using SQLite. However, when I open the app on device or emulator, it show SQLiteException:no such table.(There is select query in my code.)What’s wrong with it? Can anyone help me? Thank you in advance. Following is the log.
07-24 02:43:48.917: D/dalvikvm(2240): Not late-enabling CheckJNI (already on)
07-24 02:43:48.977: I/dalvikvm(2240): CheckJNI enabled: not enabling JNI app bug workarounds.
07-24 02:43:49.027: W/System.err(2240): No properties file. Taking properties from ClassLoader resources
07-24 02:43:49.027: W/System.err(2240): Opening «logging.properties» also failed
07-24 02:43:49.027: W/System.err(2240): java.io.IOException: BufferedInputStream is closed
07-24 02:43:49.077: D/dalvikvm(2240): GC_FOR_ALLOC freed 221K, 11% free 2818K/3132K, paused 2ms, total 3ms
07-24 02:43:49.077: I/dalvikvm-heap(2240): Grow heap (frag case) to 6.745MB for 4096012-byte allocation
07-24 02:43:49.087: D/dalvikvm(2240): GC_FOR_ALLOC freed <1K, 5% free 6817K/7136K, paused 11ms, total 11ms
07-24 02:43:49.107: D/dalvikvm(2240): GC_CONCURRENT freed <1K, 5% free 6817K/7136K, paused 0ms+0ms, total 2ms
07-24 02:43:49.247: V/WebViewChromium(2240): Binding Chromium to the main looper Looper (main, tid 1) {b2fcf240}
07-24 02:43:49.247: I/chromium(2240): [INFO:library_loader_hooks.cc(112)] Chromium logging enabled: level = 0, default verbosity = 0
07-24 02:43:49.247: I/BrowserProcessMain(2240): Initializing chromium process, renderers=0
07-24 02:43:49.337: E/chromium(2240): [ERROR:gl_surface_egl.cc(153)] No suitable EGL configs found.
07-24 02:43:49.337: E/chromium(2240): [ERROR:gl_surface_egl.cc(620)] GLSurfaceEGL::InitializeOneOff failed.
07-24 02:43:49.337: E/chromium(2240): [ERROR:gl_surface_egl.cc(153)] No suitable EGL configs found.
07-24 02:43:49.337: E/chromium(2240): [ERROR:gl_surface_egl.cc(620)] GLSurfaceEGL::InitializeOneOff failed.
07-24 02:43:49.337: E/chromium(2240): [ERROR:gpu_info_collector.cc(86)] gfx::GLSurface::InitializeOneOff() failed
07-24 02:43:49.337: W/chromium(2240): [WARNING:proxy_service.cc(888)] PAC support disabled because there is no system implementation
07-24 02:43:49.667: D/gralloc_goldfish(2240): Emulator without GPU emulation detected.
07-24 02:43:49.687: W/IInputConnectionWrapper(2240): showStatusIcon on inactive InputConnection
07-24 02:43:49.727: D/dalvikvm(2240): GC_CONCURRENT freed 194K, 4% free 7863K/8152K, paused 5ms+1ms, total 7ms
07-24 02:43:50.637: D/dalvikvm(2240): GC_CONCURRENT freed 1486K, 17% free 7967K/9548K, paused 6ms+0ms, total 9ms
07-24 02:43:50.807: D/dalvikvm(2240): GC_CONCURRENT freed 1611K, 18% free 7979K/9684K, paused 8ms+1ms, total 12ms
07-24 02:43:50.987: D/dalvikvm(2240): GC_CONCURRENT freed 1629K, 18% free 7976K/9712K, paused 12ms+0ms, total 16ms
07-24 02:43:51.077: D/dalvikvm(2240): GC_CONCURRENT freed 1625K, 18% free 7976K/9712K, paused 9ms+0ms, total 12ms
07-24 02:43:51.297: D/dalvikvm(2240): GC_CONCURRENT freed 1625K, 18% free 7977K/9712K, paused 9ms+0ms, total 13ms
07-24 02:43:51.617: D/dalvikvm(2240): Trying to load lib /data/app-lib/com.company.OFHSqlite-1/libcvm.so 0xb2fd7220
07-24 02:43:51.617: W/linker(2240): libcvm.so has text relocations. This is wasting memory and is a security risk. Please fix.
07-24 02:43:51.617: D/dalvikvm(2240): Added shared lib /data/app-lib/com.company.OFHSqlite-1/libcvm.so 0xb2fd7220
07-24 02:43:51.617: D/dalvikvm(2240): No JNI_OnLoad found in /data/app-lib/com.company.OFHSqlite-1/libcvm.so 0xb2fd7220, skipping init
07-24 02:43:51.617: D/dalvikvm(2240): Trying to load lib /data/app-lib/com.company.OFHSqlite-1/libvmchannel.so 0xb2fd7220
07-24 02:43:51.617: D/dalvikvm(2240): Added shared lib /data/app-lib/com.company.OFHSqlite-1/libvmchannel.so 0xb2fd7220
07-24 02:43:51.617: D/dalvikvm(2240): No JNI_OnLoad found in /data/app-lib/com.company.OFHSqlite-1/libvmchannel.so 0xb2fd7220, skipping init
07-24 02:43:51.617: D/dalvikvm(2240): Trying to load lib /data/app-lib/com.company.OFHSqlite-1/libvmchannel_dalvik.so 0xb2fd7220
07-24 02:43:51.617: D/dalvikvm(2240): Added shared lib /data/app-lib/com.company.OFHSqlite-1/libvmchannel_dalvik.so 0xb2fd7220
07-24 02:43:51.617: D/dalvikvm(2240): No JNI_OnLoad found in /data/app-lib/com.company.OFHSqlite-1/libvmchannel_dalvik.so 0xb2fd7220, skipping init
07-24 02:43:51.967: I/CordovaLog(2240): Changing log level to DEBUG(3)
07-24 02:43:51.967: I/CordovaLog(2240): Found preference for useBrowserHistory=true
07-24 02:43:51.967: D/CordovaLog(2240): Found preference for useBrowserHistory=true
07-24 02:43:51.967: I/CordovaLog(2240): Found preference for exit-on-suspend=false
07-24 02:43:51.967: D/CordovaLog(2240): Found preference for exit-on-suspend=false
07-24 02:43:51.977: D/JsMessageQueue(2240): Set native->JS mode to 2
07-24 02:43:51.977: D/DroidGap(2240): DroidGap.init()
07-24 02:43:51.997: D/dalvikvm(2240): GC_CONCURRENT freed 1427K, 17% free 8184K/9804K, paused 15ms+0ms, total 18ms
07-24 02:43:51.997: D/CordovaWebView(2240): >>> loadUrl(file:///data/data/com.company.OFHSqlite/storage/assets/FARs/OracleStandardADFmfUiComponents/public_html/adf.backchannel.html)
07-24 02:43:51.997: D/PluginManager(2240): init()
07-24 02:43:52.007: D/CordovaWebView(2240): >>> loadUrlNow()
07-24 02:43:52.017: D/DroidGap(2240): Resuming the App
07-24 02:43:52.097: D/DroidGap(2240): onMessage(onPageStarted,file:///data/data/com.company.OFHSqlite/storage/assets/FARs/OracleStandardADFmfUiComponents/public_html/adf.backchannel.html)
07-24 02:43:52.537: D/CVM(2240): [SEVERE — oracle.adfmf.application — LifeCycleListenerImpl — start] At the start() method
07-24 02:43:52.537: D/CVM(2240): [SEVERE — oracle.adfmf.application — LifeCycleListenerImpl — initializeDatabaseFromScript] Initilizing DB …
07-24 02:43:52.537: D/CVM(2240): [SEVERE — oracle.adfmf.application — LifeCycleListenerImpl — initializeDatabaseFromScript] DB_NAME:/data/data/com.company.OFHSqlite/files/st.db
07-24 02:43:52.537: D/CVM(2240): [SEVERE — oracle.adfmf.application — LifeCycleListenerImpl — initializeDatabaseFromScript] DBFile doesn’t Exist.
07-24 02:43:52.817: D/CVM(2240): [SEVERE — oracle.adfmf.application — LifeCycleListenerImpl — initializeDatabaseFromScript] Reading script
07-24 02:43:52.817: D/CVM(2240): [SEVERE — oracle.adfmf.application — LifeCycleListenerImpl — start] End start() method.
07-24 02:43:52.897: D/Cordova(2240): onPageFinished(file:///data/data/com.company.OFHSqlite/storage/assets/FARs/OracleStandardADFmfUiComponents/public_html/adf.backchannel.html)
07-24 02:43:52.897: D/DroidGap(2240): onMessage(onNativeReady,null)
07-24 02:43:52.897: D/DroidGap(2240): onMessage(onPageFinished,file:///data/data/com.company.OFHSqlite/storage/assets/FARs/OracleStandardADFmfUiComponents/public_html/adf.backchannel.html)
07-24 02:43:52.947: I/System.out(2240): Error initializing Network Connection: Class not found
07-24 02:43:52.977: D/DroidGap(2240): onMessage(spinner,stop)
07-24 02:43:52.997: I/System.out(2240): Back Channel Hidden Feature: Received Event: deviceready
07-24 02:43:53.037: I/System.out(2240): Back Channel Hidden Feature — Startup is complete.
07-24 02:43:53.057: D/DroidGap(2240): Paused the application!
07-24 02:43:53.057: D/CordovaWebView(2240): Handle the pause
07-24 02:43:53.057: D/DroidGap(2240): DroidGap.onCreate()
07-24 02:43:53.067: D/CordovaWebView(2240): Origin to allow: http://127.0.0.1*
07-24 02:43:53.067: D/CordovaWebView(2240): Origin to allow with subdomains: googleapis.com
07-24 02:43:53.067: D/CordovaWebView(2240): Origin to allow with subdomains: gstatic.com
07-24 02:43:53.067: D/CordovaWebView(2240): Origin to allow: elocation.oracle.com
07-24 02:43:53.067: I/CordovaLog(2240): Found log level DEBUG
07-24 02:43:53.067: I/CordovaLog(2240): Changing log level to DEBUG(3)
07-24 02:43:53.067: I/CordovaLog(2240): Found preference for useBrowserHistory=true
07-24 02:43:53.067: D/CordovaLog(2240): Found preference for useBrowserHistory=true
07-24 02:43:53.067: I/CordovaLog(2240): Found preference for exit-on-suspend=false
07-24 02:43:53.067: D/CordovaLog(2240): Found preference for exit-on-suspend=false
07-24 02:43:53.087: D/JsMessageQueue(2240): Set native->JS mode to 2
07-24 02:43:53.087: D/DroidGap(2240): DroidGap.init()
07-24 02:43:53.087: D/CordovaWebView(2240): >>> loadUrl(file:///data/data/com.company.OFHSqlite/storage/assets/www/bootstrap.html?file=com.oraclefusionhub.sqlite.UIPage%2FUIPage.amx&featureRoot=..%2FFARs%2FViewController&profile_json_folder_override=/data/data/com.company.OFHSqlite/files//baseProfiles&appStartTime=1406184229075&webviewStartTime=WEBVIEW_TEMPLATE_TIME_LOCATION&lang=en-us)
07-24 02:43:53.087: D/PluginManager(2240): init()
07-24 02:43:53.097: D/CordovaWebView(2240): >>> loadUrlNow()
07-24 02:43:53.097: D/DroidGap(2240): Resuming the App
07-24 02:43:53.097: D/SoftKeyboardDetect(2240): Ignore this event
07-24 02:43:53.127: D/dalvikvm(2240): GC_FOR_ALLOC freed 439K, 17% free 8428K/10092K, paused 26ms, total 26ms
07-24 02:43:53.127: I/dalvikvm-heap(2240): Grow heap (frag case) to 9.636MB for 1382412-byte allocation
07-24 02:43:53.127: D/dalvikvm(2240): GC_FOR_ALLOC freed 0K, 15% free 9778K/11444K, paused 2ms, total 2ms
07-24 02:43:53.127: W/AwContents(2240): nativeOnDraw failed; clearing to background color.
07-24 02:43:53.207: D/dalvikvm(2240): GC_FOR_ALLOC freed 1371K, 27% free 8416K/11444K, paused 4ms, total 4ms
07-24 02:43:53.207: W/AwContents(2240): nativeOnDraw failed; clearing to background color.
07-24 02:43:53.337: D/DroidGap(2240): onMessage(onPageStarted,file:///data/data/com.company.OFHSqlite/storage/assets/www/bootstrap.html?file=com.oraclefusionhub.sqlite.UIPage%2FUIPage.amx&featureRoot=..%2FFARs%2FViewController&profile_json_folder_override=/data/data/com.company.OFHSqlite/files//baseProfiles&appStartTime=1406184229075&webviewStartTime=WEBVIEW_TEMPLATE_TIME_LOCATION&lang=en-us)
07-24 02:43:54.317: W/AwContents(2240): nativeOnDraw failed; clearing to background color.
07-24 02:43:54.327: W/AwContents(2240): nativeOnDraw failed; clearing to background color.
07-24 02:43:54.357: W/AwContents(2240): nativeOnDraw failed; clearing to background color.
07-24 02:43:54.367: W/AwContents(2240): nativeOnDraw failed; clearing to background color.
07-24 02:43:54.397: W/AwContents(2240): nativeOnDraw failed; clearing to background color.
07-24 02:43:54.437: W/AwContents(2240): nativeOnDraw failed; clearing to background color.
07-24 02:43:54.477: W/AwContents(2240): nativeOnDraw failed; clearing to background color.
07-24 02:43:54.497: W/AwContents(2240): nativeOnDraw failed; clearing to background color.
07-24 02:43:54.537: W/AwContents(2240): nativeOnDraw failed; clearing to background color.
07-24 02:43:54.557: W/AwContents(2240): nativeOnDraw failed; clearing to background color.
07-24 02:43:54.707: D/Cordova(2240): onPageFinished(file:///data/data/com.company.OFHSqlite/storage/assets/www/bootstrap.html?file=com.oraclefusionhub.sqlite.UIPage%2FUIPage.amx&featureRoot=..%2FFARs%2FViewController&profile_json_folder_override=/data/data/com.company.OFHSqlite/files//baseProfiles&appStartTime=1406184229075&webviewStartTime=WEBVIEW_TEMPLATE_TIME_LOCATION&lang=en-us)
07-24 02:43:54.707: D/DroidGap(2240): onMessage(onNativeReady,null)
07-24 02:43:54.707: D/DroidGap(2240): onMessage(onPageFinished,file:///data/data/com.company.OFHSqlite/storage/assets/www/bootstrap.html?file=com.oraclefusionhub.sqlite.UIPage%2FUIPage.amx&featureRoot=..%2FFARs%2FViewController&profile_json_folder_override=/data/data/com.company.OFHSqlite/files//baseProfiles&appStartTime=1406184229075&webviewStartTime=WEBVIEW_TEMPLATE_TIME_LOCATION&lang=en-us)
07-24 02:43:54.987: I/System.out(2240): Error initializing Network Connection: Class not found
07-24 02:43:55.107: D/DroidGap(2240): onMessage(spinner,stop)
07-24 02:43:56.917: D/CVM(2240): [SEVERE — oracle.adfmf.application — EmployeeDC — getEmployeesFromDB] OFA:Entered getEmployeesFromDB
07-24 02:43:56.917: D/CVM(2240): [SEVERE — oracle.adfmf.application — ConnectionFactory — getConnection] At the ConnectionFactory Package getConnection Method.
07-24 02:43:56.947: D/CVM(2240): [SEVERE — oracle.adfmf.application — EmployeeDC — getEmployeesFromDB] test1
07-24 02:43:56.947: D/CVM(2240): [SEVERE — oracle.adfmf.application — EmployeeDC — getEmployeesFromDB] SQLite.Exception: no such table: employees
07-24 02:43:56.947: D/CVM(2240): java.sql.SQLException: SQLite.Exception: no such table: employees
07-24 02:43:56.947: D/CVM(2240): at SQLite.JDBC0.JDBCStatement.executeQuery(Unknown Source)
07-24 02:43:56.947: D/CVM(2240): at SQLite.JDBC0.JDBCStatement.executeQuery(Unknown Source)
07-24 02:43:56.947: D/CVM(2240): at com.oraclefusionhub.sqlite.application.EmployeeDC.getEmployeesFromDB(EmployeeDC.java:32)
07-24 02:43:56.947: D/CVM(2240): at com.oraclefusionhub.sqlite.application.EmployeeDC.getEmployees(EmployeeDC.java:20)
07-24 02:43:56.947: D/CVM(2240): at oracle.adfmf.dc.bean.ConcreteJavaBeanObject.getAccessorValue(Unknown Source)
07-24 02:43:56.947: D/CVM(2240): at oracle.adfmf.dc.bean.ConcreteJavaBeanObject.getAttribute(Unknown Source)
07-24 02:43:56.947: D/CVM(2240): at oracle.adfmf.util.GenericTypeIteratorAdapter.getWrappedDataProvider(Unknown Source)
07-24 02:43:56.947: D/CVM(2240): at oracle.adfmf.util.GenericTypeIteratorAdapter.getDataProvider(Unknown Source)
07-24 02:43:56.947: D/CVM(2240): at oracle.adfmf.dc.GenericJavaBeanDataControlAdapter.getAccessorDataProvider(Unknown Source)
07-24 02:43:56.947: D/CVM(2240): at oracle.adfmf.dc.GenericJavaBeanDataControlAdapter.getDataProvider(Unknown Source)
07-24 02:43:56.947: D/CVM(2240): at oracle.adfmf.bindings.dbf.AmxIteratorBinding.loadBasicIterator(Unknown Source)
07-24 02:43:56.947: D/CVM(2240): at oracle.adfmf.bindings.dbf.AmxIteratorBinding.getIterator(Unknown Source)
07-24 02:43:56.947: D/CVM(2240): at oracle.adfmf.bindings.dbf.AmxIteratorBinding.getIterator(Unknown Source)
07-24 02:43:56.947: D/CVM(2240): at oracle.adfmf.bindings.dbf.AmxTreeBinding.getIterator(Unknown Source)
07-24 02:43:56.947: D/CVM(2240): at oracle.adfmf.bindings.dbf.AmxTreeBinding.getCollectionModel(Unknown Source)
07-24 02:43:56.947: D/CVM(2240): at oracle.adfmf.bindings.dbf.AmxTreeBinding.getCollectionModel(Unknown Source)
07-24 02:43:56.947: D/CVM(2240): at javax.el.BeanELResolver.getValue(Unknown Source)
07-24 02:43:56.947: D/CVM(2240): at javax.el.CompositeELResolver.getValue(Unknown Source)
07-24 02:43:56.947: D/CVM(2240): at oracle.adfmf.framework.model.DiagnosticCompositeELResolver.getValue(Unknown Source)
07-24 02:43:56.947: D/CVM(2240): at javax.el.CompositeELResolver.getValue(Unknown Source)
07-24 02:43:56.947: D/CVM(2240): at de.odysseus.el.util.SimpleResolver.getValue(Unknown Source)
07-24 02:43:56.947: D/CVM(2240): at de.odysseus.el.tree.impl.ast.AstProperty.eval(Unknown Source)
07-24 02:43:56.947: D/CVM(2240): at de.odysseus.el.tree.impl.ast.AstProperty.eval(Unknown Source)
07-24 02:43:56.947: D/CVM(2240): at de.odysseus.el.tree.impl.ast.AstEval.eval(Unknown Source)
07-24 02:43:56.947: D/CVM(2240): at de.odysseus.el.tree.impl.ast.AstNode.getValue(Unknown Source)
07-24 02:43:56.947: D/CVM(2240): at de.odysseus.el.TreeValueExpression.getValue(Unknown Source)
07-24 02:43:57.037: D/CVM(2240): at oracle.adfmf.framework.api.Model.getValue(Unknown Source)
07-24 02:43:57.037: D/CVM(2240): at oracle.adfmf.framework.contract.adf.application.GenericInvokeRequestHandler.invoke(Unknown Source)
07-24 02:43:57.037: D/CVM(2240): at oracle.adfmf.framework.contract.adf.application.GenericInvokeRequestHandler.invoke(Unknown Source)
07-24 02:43:57.037: D/CVM(2240): at oracle.adfmf.framework.contract.adf.application.GenericInvokeRequestHandler.process(Unknown Source)
07-24 02:43:57.037: D/CVM(2240): at oracle.adfmf.framework.FeatureContext.handle(Unknown Source)
07-24 02:43:57.037: D/CVM(2240): at oracle.adfmf.framework.AdfChannel.handle(Unknown Source)
07-24 02:43:57.037: D/CVM(2240): at com.oracle.cvm.channel.impl.VMChannelImpl.run(VMChannelImpl.java:451)
07-24 02:43:57.037: D/CVM(2240): at java.lang.Thread.run(Unknown Source)
07-24 02:43:57.037: D/CVM(2240): at java.lang.Thread.startup(Unknown Source)
07-24 02:43:57.457: I/System.out(2240): [SEVERE — oracle.adfmf.framework — adf.mf.internal — logError] Request: «#{bindings.employees.collectionModel.selectedRow}» exception: {«message»:»java.sql.SQLException: SQLite.Exception: no such table: employees»,»errorCode»:-1,».type»:»oracle.adfmf.framework.exception.AdfInvocationRuntimeException»,».exception»:true,»severity»:»ERROR»,»errorCategory»:»BEAN»}
Thank you,
Sheng
SqliteException: no such table #493
Comments
I am stuck with this error:
[ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: SqliteException: no such table: my_entries
I have other tables that work fine, but lately I can’t add other tables.
- Clear Flutter and rebuild everything
- Clear the Cache of the App and Uninstall and Reinstall it
- change the name of the DB like ‘db2.sqlite’
- Change the Name of the new tables
- Run it on another virtual device
I read a similar issue about backup of the database but it shouldn’t be this issue.
The text was updated successfully, but these errors were encountered:
Thanks for the report. Can you try to enable logStatements on the VmDatabase and see if the CREATE TABLE statement for my_entries appears?
Also, do you have a custom migration strategy or anything else that might cause this?
I had some migration strategy, I removed them and clean and tried everything again without success.
I/flutter ( 5937): Moor: Sent CREATE TABLE IF NOT EXISTS my_entries (id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, icon VARCHAR NOT NULL, title VARCHAR NOT NULL, notes VARCHAR NULL, title VARCHAR NOT NULL, parent_id INTEGER NOT NULL, duration INTEGER NOT NULL, ended_date INTEGER NULL, started_date INTEGER NOT NULL, inserted_date INTEGER NULL); with args []
Something more strange is that sometimes the «no such table error» is about my_entries and sometimes is about another table: runnings
Of the my_entries, the CREATE TABLE statement is always sent.
Of the runnings, the CREATE TABLE statement is NEVER sent.
Of the runnings, the CREATE TABLE statement is NEVER sent.
That’s weird. Is the generated code up-to-date? I don’t see how there could be a state where the generated code contains generated table classes but doesn’t include the table in allTables .
I don’t know why, don’t see how the generated code could not be up to date. (I am using Android Studio 4.1)
By the way, I don’t think it is connected, but every time I:
- Delete the .g.dart
- Do flutter clean and package get
- Then flutter packages pub run build_runner build
- Uninstall the App.
When I delete the .g.dart file I get 2 out of 3 times this error:
Then the times it succeeds to generate the file I get these errors of not such table: sometimes triggers my_entries sometime another table: my_runnings (I referred before as runnings table ).
The CREATE TABLE of my_entries is always called:
I/flutter ( 8240): Moor: Sent CREATE TABLE IF NOT EXISTS my_entries (id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, icon VARCHAR NOT NULL, title VARCHAR NOT NULL, notes VARCHAR NULL, title VARCHAR NOT NULL, parent_id INTEGER NOT NULL, duration INTEGER NOT NULL, ended_date INTEGER NULL, started_date INTEGER NOT NULL, inserted_date INTEGER NULL); with args []
Of my_runnings, it is not!
If for allTables you mean:
(PS: there are a lot of other tables that I am removing in the list)
Источник
I’ve been looking for solutions since yesterday and I can’t seem to find any. It always says there’s no such table when I try to insert a record on my database.
Error Details: Mono.Data.Sqlite.SQLite3.Prepare (Mono.Data.Sqlite.SqliteConnection cnn, System.String strSql, Mono.Data.Sqlite.SqliteStatement previous, UInt32 timeoutMS, System.String& strRemain) Mono.Data.Sqlite.SqliteCommand.BuildNextCommand () UnityEngine.EventSystems.EventSystem:Update()
T$$anonymous$$s is my code:
connectionString = «URI=file:» + Application.persistentDataPath + «/ReportCards.sqlite»;
string filepath = Application.persistentDataPath + «/» + «ReportCards.sqlite»;
if (!File.Exists (filepath))
{
WWW loadDB = new WWW ("jar:file://" + Application.dataPath + "!/assets/" + "ReportCards.sqlite");
w$$anonymous$$le (!loadDB.isDone) {}
File.WriteAllBytes (filepath, loadDB.bytes);
}
connectionString = "URI=file:" + filepath;
dbcon = new SqliteConnection (connectionString);
dbcon.Open ();
private void InsertScore(string name ,int score, int time, string remarks) {
if (playerScore >= 5 && playerScore<= 26)
{
remarks = "EXCELLENT";
}
else if (playerScore == 4)
{
remarks = "OUTSTANDING";
}
else if (playerScore == 3)
{
remarks = "VERY GOOD";
}
else if (playerScore == 2)
{
remarks = "GOOD";
}
else if (playerScore == 1)
{
remarks = "FAIR";
}
else if (playerScore == 0)
{
remarks = "NEEDS IMPROVEMENT";
}
using (IDbConnection dbConnection = new SqliteConnection (connectionString))
{
dbConnection.Open ();
using (IDbCommand dbCmd = dbConnection.CreateCommand ())
{
string sqlQuery = String.Format ("INSERT INTO LetterRecognition(Name,Score,TimeConsumed_Seconds,Remarks)VALUES("{0}","{1}","{2}","{3}")" ,name,score,time,remarks);
dbCmd.CommandText = sqlQuery;
dbCmd.ExecuteScalar ();
dbConnection.Close ();
}
}
}