forked from github/dataease
fix: NUMERIC 类型丢失精度的问题
This commit is contained in:
parent
793061c7a6
commit
15d18488c9
@ -23,6 +23,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.sql.*;
|
import java.sql.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
@ -286,6 +287,10 @@ public class JdbcProvider extends DefaultJdbcProvider {
|
|||||||
case Types.BOOLEAN:
|
case Types.BOOLEAN:
|
||||||
row[j] = rs.getBoolean(j + 1) ? "1" : "0";
|
row[j] = rs.getBoolean(j + 1) ? "1" : "0";
|
||||||
break;
|
break;
|
||||||
|
case Types.NUMERIC:
|
||||||
|
BigDecimal bigDecimal = rs.getBigDecimal(j + 1);
|
||||||
|
row[j] = bigDecimal == null ? null: bigDecimal.toString();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
if (metaData.getColumnTypeName(j + 1).toLowerCase().equalsIgnoreCase("blob")) {
|
if (metaData.getColumnTypeName(j + 1).toLowerCase().equalsIgnoreCase("blob")) {
|
||||||
row[j] = rs.getBlob(j + 1) == null ? "" : rs.getBlob(j + 1).toString();
|
row[j] = rs.getBlob(j + 1) == null ? "" : rs.getBlob(j + 1).toString();
|
||||||
|
Loading…
Reference in New Issue
Block a user