|
@@ -4,6 +4,7 @@ import org.dbsyncer.connector.ConnectorException;
|
|
import org.dbsyncer.connector.database.AbstractSetter;
|
|
import org.dbsyncer.connector.database.AbstractSetter;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
|
+import java.math.BigInteger;
|
|
import java.sql.PreparedStatement;
|
|
import java.sql.PreparedStatement;
|
|
import java.sql.SQLException;
|
|
import java.sql.SQLException;
|
|
|
|
|
|
@@ -21,6 +22,16 @@ public class NumericSetter extends AbstractSetter<BigDecimal> {
|
|
ps.setInt(i, integer);
|
|
ps.setInt(i, integer);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ if(val instanceof Long){
|
|
|
|
+ Long l = (Long) val;
|
|
|
|
+ ps.setLong(i, l);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if(val instanceof BigInteger){
|
|
|
|
+ BigInteger b = (BigInteger) val;
|
|
|
|
+ ps.setLong(i, new Long(b.longValue()));
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
throw new ConnectorException(String.format("NumericSetter can not find type [%s], val [%s]", type, val));
|
|
throw new ConnectorException(String.format("NumericSetter can not find type [%s], val [%s]", type, val));
|
|
}
|
|
}
|
|
}
|
|
}
|