|
|
@@ -1,6 +1,8 @@
|
|
|
package com.usoftchina.uas.office.service;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.usoftchina.uas.office.context.MasterHolder;
|
|
|
+import com.usoftchina.uas.office.jdbc.DynamicDataSource;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.dao.DataAccessException;
|
|
|
import org.springframework.dao.EmptyResultDataAccessException;
|
|
|
@@ -46,6 +48,11 @@ public abstract class AbstractService {
|
|
|
|
|
|
protected <T> T queryForBean(String statement, Class<T> targetCls, Object... arguments) {
|
|
|
try {
|
|
|
+ try {
|
|
|
+ System.out.println(((DynamicDataSource)jdbcTemplate.getDataSource()).lookupSchema());
|
|
|
+ System.out.println(MasterHolder.get());
|
|
|
+ } catch (Exception e) {
|
|
|
+ }
|
|
|
return jdbcTemplate.queryForObject(statement, new BeanPropertyRowMapper<>(targetCls), arguments);
|
|
|
} catch (EmptyResultDataAccessException e) {
|
|
|
return null;
|