|
|
@@ -5,6 +5,7 @@ import org.json.simple.JSONObject;
|
|
|
import org.json.simple.parser.JSONParser;
|
|
|
import org.json.simple.parser.ParseException;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
|
@@ -18,6 +19,24 @@ import java.util.*;
|
|
|
@RequestMapping("/mdb")
|
|
|
public class MdbController extends BaseController {
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ @GetMapping("/gettablesMdb")
|
|
|
+ public void gettablesMdb() throws Exception {
|
|
|
+ String folderURL = "C:\\Users\\Administrator\\Desktop\\06\\XZQData.mdb";
|
|
|
+ List<Map<String, Object>> resList = MdbTables(folderURL, null, null);
|
|
|
+
|
|
|
+ Map<String, Object> map = resList.get(0);
|
|
|
+ String tablename = map.get("name").toString();
|
|
|
+
|
|
|
+ Map<String, Object> resMap = MdbTableContent(folderURL,tablename, null, null, 1, 10);
|
|
|
+ System.out.println(resMap);
|
|
|
+
|
|
|
+ System.out.println(resMap);
|
|
|
+ System.out.println("-----------------");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
*
|
|
|
* 获取mdb下的属性表
|
|
|
@@ -233,7 +252,13 @@ public class MdbController extends BaseController {
|
|
|
for (int i = 1; i <= data.getColumnCount(); i++) {
|
|
|
//列名
|
|
|
String columnName = data.getColumnName(i);
|
|
|
- map.put(columnName, rs.getString(i));
|
|
|
+ //map.put(columnName, rs.getString(i));
|
|
|
+ Object value = rs.getObject(i);
|
|
|
+ if (value instanceof Blob) {
|
|
|
+ map.put(columnName, "[BLOB]"); //todo 这里先简单处理一下blob类型,后续可以根据实际需求进行优化
|
|
|
+ } else {
|
|
|
+ map.put(columnName, String.valueOf(value));
|
|
|
+ }
|
|
|
}
|
|
|
dataList.add(map);
|
|
|
}
|