首页 > 解决方案 > 使用spring jdbc查询多个表

问题描述

我需要查询 5 个表,根据响应形成一个 json 并发送给消费者。我不想使用 jdbcTemplate 逐个查询,而是想进行一次调用并获得所有响应。

{
   "TableA":[
      {
          table rows as data
      }
   ],
   "TableB":[
      {
          table rows as data
      }
   ],
   "TableC":[
      {
          table rows as data
      }
   ],
   "TableD":[
      {
          table rows as data
      }
   ],
   "TableE":[
      {
          table rows as data
      }
   ]
}

由于我是 spring jdbc 的新手,因此很难实现它。

标签: javajdbcspring-dataspring-jdbcjdbctemplate

解决方案


推荐阅读