|
|
@@ -1,5 +1,6 @@
|
|
|
package com.usoftchina.bi.server.service.dataSource;
|
|
|
|
|
|
+import com.usoftchina.bi.core.exception.MyException;
|
|
|
import com.usoftchina.bi.server.dao.dataSource.DataColumnMapper;
|
|
|
import com.usoftchina.bi.server.dao.dataSource.DataConnectorMapper;
|
|
|
import com.usoftchina.bi.server.model.bo.ToSql;
|
|
|
@@ -8,6 +9,7 @@ import com.usoftchina.bi.core.base.RepCode;
|
|
|
import com.usoftchina.bi.core.base.RepEntity;
|
|
|
import com.usoftchina.bi.server.model.vo.dataVo.ColumnTypeInfo;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.dao.DataAccessException;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.jdbc.support.rowset.SqlRowSet;
|
|
|
import org.springframework.jdbc.support.rowset.SqlRowSetMetaData;
|
|
|
@@ -41,7 +43,12 @@ public class ImplementSqlService {
|
|
|
return new RepEntity(RepCode.ChartsNameNull);
|
|
|
}
|
|
|
|
|
|
- SqlRowSet sqlRowSet = jdbcTemplate.queryForRowSet(sqlStr);
|
|
|
+ SqlRowSet sqlRowSet = null;
|
|
|
+ try {
|
|
|
+ sqlRowSet = jdbcTemplate.queryForRowSet(sqlStr);
|
|
|
+ } catch (DataAccessException e) {
|
|
|
+ throw new MyException(e.getCause().getMessage());
|
|
|
+ }
|
|
|
SqlRowSetMetaData metaData = sqlRowSet.getMetaData();
|
|
|
int length = metaData.getColumnCount();
|
|
|
List<ColumnTypeInfo> columnTypeInfoList = new ArrayList<>();
|