Вернул выборку с ручным заданием типов

This commit is contained in:
Igor I
2024-08-07 19:08:12 +05:00
parent 52409ffda6
commit 671d839e9f
3 changed files with 8 additions and 7 deletions

View File

@ -311,13 +311,12 @@ public class MySynchronizationOld
rid_sendFrmLocust = myThread.addRequest(MySynchronizationOld.URL+"/get/", xml, null,null); rid_sendFrmLocust = myThread.addRequest(MySynchronizationOld.URL+"/get/", xml, null,null);
//Отправляю данные координат отдельно (без подтверждения доставки, потом нужно добавить поле send boolean и отправлять отдельно от frmlocustdel) //Отправляю данные координат отдельно (без подтверждения доставки, потом нужно добавить поле send boolean и отправлять отдельно от frmlocustdel)
Cursor cursor3 = dboh.getReadableDatabase().rawQuery("select uid,del,seq,frmlocustdel_uid,pos,lon,lat from frmlocustdel_locations where frmlocustdel_uid=? order by pos", new String[] { String.valueOf(uid) }); /* Cursor cursor3 = dboh.getReadableDatabase().rawQuery("select uid,del,seq,frmlocustdel_uid,pos,lon,lat from frmlocustdel_locations where frmlocustdel_uid=? order by pos", new String[] { String.valueOf(uid) });
ByteArrayOutputStream outStream = new ByteArrayOutputStream(); ByteArrayOutputStream outStream = new ByteArrayOutputStream();
TCTableTools2.getTCTableFromCursor("frmlocustdel_locations", 0, cursor3, outStream); TCTableTools2.getTCTableFromCursor("frmlocustdel_locations", 0, cursor3, outStream);
myThread.addRequest(MySynchronizationOld.URL+"/asdc/tctable/", null, null, outStream.toByteArray()); myThread.addRequest(MySynchronizationOld.URL+"/asdc/tctable/", null, null, outStream.toByteArray());*/
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
/* ByteArrayOutputStream outStream = new ByteArrayOutputStream();
TCTable tbl = new TCTable("frmlocustdel_locations", 0); TCTable tbl = new TCTable("frmlocustdel_locations", 0);
tbl.addField(new TCField("uid",TCField.BD_UTF8_1)); tbl.addField(new TCField("uid",TCField.BD_UTF8_1));
tbl.addField(new TCField("del",TCField.BD_UINT1)); tbl.addField(new TCField("del",TCField.BD_UINT1));
@ -336,15 +335,15 @@ public class MySynchronizationOld
tbl.fields.get(2).setValue(cursor3.getString(2)); tbl.fields.get(2).setValue(cursor3.getString(2));
tbl.fields.get(3).setValue(cursor3.getString(3)); tbl.fields.get(3).setValue(cursor3.getString(3));
tbl.fields.get(4).setValue(cursor3.getString(4)); tbl.fields.get(4).setValue(cursor3.getString(4));
tbl.fields.get(5).setValue(cursor3.getString(5)); tbl.fields.get(5).setDoubleVal(cursor3.getDouble(5));
tbl.fields.get(6).setValue(cursor3.getString(6)); tbl.fields.get(6).setDoubleVal(cursor3.getDouble(6));
tbl.getCol(outStream); tbl.getCol(outStream);
}while (cursor3.moveToNext()); }while (cursor3.moveToNext());
} }
cursor3.close(); cursor3.close();
//Отправляю пакет данных на сервер для вставки либо обновления //Отправляю пакет данных на сервер для вставки либо обновления
myThread.addRequest(MySynchronizationOld.URL+"/asdc/tctable/", null, null, outStream.toByteArray()); myThread.addRequest(MySynchronizationOld.URL+"/asdc/tctable/", null, null, outStream.toByteArray());
*/
}while (cursor.moveToNext()); }while (cursor.moveToNext());
} }

View File

@ -27,6 +27,7 @@ public class TCTableTools2 {
return result; return result;
} }
//TODO не получится! нет такого функционала чтобы выбрать из Cursor типы полей если поле будет null то вернёт тип поля null!!!!
//Записать таблицу в OutputStream из курсора андроида //Записать таблицу в OutputStream из курсора андроида
public static boolean getTCTableFromCursor(String name, int id, Cursor cursor, OutputStream os) { public static boolean getTCTableFromCursor(String name, int id, Cursor cursor, OutputStream os) {
TCTable tbl = new TCTable(name, id); TCTable tbl = new TCTable(name, id);

View File

@ -5,6 +5,7 @@
<domain includeSubdomains="true">ccalm.org</domain> <domain includeSubdomains="true">ccalm.org</domain>
<domain includeSubdomains="true">test.ccalm.org</domain> <domain includeSubdomains="true">test.ccalm.org</domain>
<domain includeSubdomains="true">192.168.200.100</domain> <domain includeSubdomains="true">192.168.200.100</domain>
<domain includeSubdomains="true">192.168.0.170</domain>
<domain includeSubdomains="true">10.0.2.2</domain> <domain includeSubdomains="true">10.0.2.2</domain>
</domain-config> </domain-config>
</network-security-config> </network-security-config>