本文整理了Java中org.h2.value.Value.getBigDecimal()
方法的一些代码示例,展示了Value.getBigDecimal()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Value.getBigDecimal()
方法的具体详情如下:
包路径:org.h2.value.Value
类名称:Value
方法名:getBigDecimal
暂无
代码示例来源:origin: apache/ignite
/**
* @param val Value.
*/
public GridH2Decimal(Value val) {
assert val.getType() == Value.DECIMAL : val.getType();
BigDecimal x = val.getBigDecimal();
scale = x.scale();
b = x.unscaledValue().toByteArray();
}
代码示例来源:origin: com.h2database/h2
/**
* Returns the value of the specified column as a BigDecimal.
*
* @param columnIndex (1,2,...)
* @return the value
* @throws SQLException if the column is not found or if the result set is
* closed
*/
@Override
public BigDecimal getBigDecimal(int columnIndex) throws SQLException {
try {
debugCodeCall("getBigDecimal", columnIndex);
return get(columnIndex).getBigDecimal();
} catch (Exception e) {
throw logAndConvert(e);
}
}
代码示例来源:origin: com.h2database/h2
/**
* Returns the value of the specified column as a BigDecimal.
*
* @param columnLabel the column label
* @return the value
* @throws SQLException if the column is not found or if the result set is
* closed
*/
@Override
public BigDecimal getBigDecimal(String columnLabel) throws SQLException {
try {
debugCodeCall("getBigDecimal", columnLabel);
return get(columnLabel).getBigDecimal();
} catch (Exception e) {
throw logAndConvert(e);
}
}
代码示例来源:origin: com.h2database/h2
return type.cast(value.getBigDecimal());
} else if (type == BigInteger.class) {
return type.cast(value.getBigDecimal().toBigInteger());
} else if (type == String.class) {
return type.cast(value.getString());
代码示例来源:origin: com.h2database/h2
/**
* Returns the value of the specified column as a BigDecimal.
*
* @deprecated use {@link #getBigDecimal(int)}
*
* @param columnIndex (1,2,...)
* @param scale the scale of the returned value
* @return the value
* @throws SQLException if the column is not found or if the result set is
* closed
*/
@Deprecated
@Override
public BigDecimal getBigDecimal(int columnIndex, int scale)
throws SQLException {
try {
if (isDebugEnabled()) {
debugCode("getBigDecimal(" + columnIndex + ", " + scale + ");");
}
if (scale < 0) {
throw DbException.getInvalidValueException("scale", scale);
}
BigDecimal bd = get(columnIndex).getBigDecimal();
return bd == null ? null : ValueDecimal.setScale(bd, scale);
} catch (Exception e) {
throw logAndConvert(e);
}
}
代码示例来源:origin: com.h2database/h2
/**
* Returns the value of the specified column as a BigDecimal.
*
* @deprecated use {@link #getBigDecimal(String)}
*
* @param columnLabel the column label
* @param scale the scale of the returned value
* @return the value
* @throws SQLException if the column is not found or if the result set is
* closed
*/
@Deprecated
@Override
public BigDecimal getBigDecimal(String columnLabel, int scale)
throws SQLException {
try {
if (isDebugEnabled()) {
debugCode("getBigDecimal(" +
StringUtils.quoteJavaString(columnLabel)+", "+scale+");");
}
if (scale < 0) {
throw DbException.getInvalidValueException("scale", scale);
}
BigDecimal bd = get(columnLabel).getBigDecimal();
return bd == null ? null : ValueDecimal.setScale(bd, scale);
} catch (Exception e) {
throw logAndConvert(e);
}
}
代码示例来源:origin: com.h2database/h2
BigDecimal x = v.getBigDecimal();
if (BigDecimal.ZERO.equals(x)) {
buff.put((byte) DECIMAL_0_1);
代码示例来源:origin: com.h2database/h2
case Value.DOUBLE:
case Value.FLOAT:
result = ValueString.get(ToChar.toChar(v0.getBigDecimal(),
v1 == null ? null : v1.getString(),
v2 == null ? null : v2.getString()),
代码示例来源:origin: com.h2database/h2
r.getValue(session).getBigDecimal()
.compareTo(ValueLong.MIN_BD) == 0) {
代码示例来源:origin: org.apache.ignite/ignite-indexing
/**
* @param val Value.
*/
public GridH2Decimal(Value val) {
assert val.getType() == Value.DECIMAL : val.getType();
BigDecimal x = val.getBigDecimal();
scale = x.scale();
b = x.unscaledValue().toByteArray();
}
代码示例来源:origin: com.h2database/com.springsource.org.h2
/**
* Returns the value of the specified column as a String.
*
* @param columnIndex (1,2,...)
* @return the value
* @throws SQLException if the column is not found or if the result set is closed
*/
public BigDecimal getBigDecimal(int columnIndex) throws SQLException {
try {
debugCodeCall("getBigDecimal", columnIndex);
return get(columnIndex).getBigDecimal();
} catch (Throwable e) {
throw logAndConvert(e);
}
}
代码示例来源:origin: com.h2database/com.springsource.org.h2
/**
* Returns the value of the specified column as a String.
*
* @param columnName the name of the column label
* @return the value
* @throws SQLException if the column is not found or if the result set is closed
*/
public BigDecimal getBigDecimal(String columnName) throws SQLException {
try {
debugCodeCall("getBigDecimal", columnName);
return get(columnName).getBigDecimal();
} catch (Throwable e) {
throw logAndConvert(e);
}
}
代码示例来源:origin: org.wowtools/h2
/**
* Returns the value of the specified column as a BigDecimal.
*
* @param columnLabel the column label
* @return the value
* @throws SQLException if the column is not found or if the result set is
* closed
*/
@Override
public BigDecimal getBigDecimal(String columnLabel) throws SQLException {
try {
debugCodeCall("getBigDecimal", columnLabel);
return get(columnLabel).getBigDecimal();
} catch (Exception e) {
throw logAndConvert(e);
}
}
代码示例来源:origin: org.wowtools/h2
/**
* Returns the value of the specified column as a BigDecimal.
*
* @param columnIndex (1,2,...)
* @return the value
* @throws SQLException if the column is not found or if the result set is
* closed
*/
@Override
public BigDecimal getBigDecimal(int columnIndex) throws SQLException {
try {
debugCodeCall("getBigDecimal", columnIndex);
return get(columnIndex).getBigDecimal();
} catch (Exception e) {
throw logAndConvert(e);
}
}
代码示例来源:origin: com.eventsourcing/h2
/**
* Returns the value of the specified column as a BigDecimal.
*
* @param columnLabel the column label
* @return the value
* @throws SQLException if the column is not found or if the result set is
* closed
*/
@Override
public BigDecimal getBigDecimal(String columnLabel) throws SQLException {
try {
debugCodeCall("getBigDecimal", columnLabel);
return get(columnLabel).getBigDecimal();
} catch (Exception e) {
throw logAndConvert(e);
}
}
代码示例来源:origin: com.eventsourcing/h2
/**
* Returns the value of the specified column as a BigDecimal.
*
* @param columnIndex (1,2,...)
* @return the value
* @throws SQLException if the column is not found or if the result set is
* closed
*/
@Override
public BigDecimal getBigDecimal(int columnIndex) throws SQLException {
try {
debugCodeCall("getBigDecimal", columnIndex);
return get(columnIndex).getBigDecimal();
} catch (Exception e) {
throw logAndConvert(e);
}
}
代码示例来源:origin: com.eventsourcing/h2
/**
* Returns the value of the specified column as a BigDecimal.
*
* @deprecated use {@link #getBigDecimal(int)}
*
* @param columnIndex (1,2,...)
* @param scale the scale of the returned value
* @return the value
* @throws SQLException if the column is not found or if the result set is
* closed
*/
@Deprecated
@Override
public BigDecimal getBigDecimal(int columnIndex, int scale)
throws SQLException {
try {
if (isDebugEnabled()) {
debugCode("getBigDecimal(" + columnIndex + ", " + scale + ");");
}
if (scale < 0) {
throw DbException.getInvalidValueException("scale", scale);
}
BigDecimal bd = get(columnIndex).getBigDecimal();
return bd == null ? null : ValueDecimal.setScale(bd, scale);
} catch (Exception e) {
throw logAndConvert(e);
}
}
代码示例来源:origin: org.wowtools/h2
/**
* Returns the value of the specified column as a BigDecimal.
*
* @deprecated use {@link #getBigDecimal(int)}
*
* @param columnIndex (1,2,...)
* @param scale the scale of the returned value
* @return the value
* @throws SQLException if the column is not found or if the result set is
* closed
*/
@Deprecated
@Override
public BigDecimal getBigDecimal(int columnIndex, int scale)
throws SQLException {
try {
if (isDebugEnabled()) {
debugCode("getBigDecimal(" + columnIndex + ", " + scale + ");");
}
if (scale < 0) {
throw DbException.getInvalidValueException("scale", scale);
}
BigDecimal bd = get(columnIndex).getBigDecimal();
return bd == null ? null : ValueDecimal.setScale(bd, scale);
} catch (Exception e) {
throw logAndConvert(e);
}
}
代码示例来源:origin: com.h2database/com.springsource.org.h2
/**
* Returns the value of the specified column as a String.
*
* @deprecated
*
* @param columnIndex (1,2,...)
* @return the value
* @throws SQLException if the column is not found or if the result set is
* closed
*/
public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException {
try {
if (debug()) {
debugCode("getBigDecimal(" + columnIndex+", "+scale+");");
}
if (scale < 0) {
throw Message.getInvalidValueException(""+scale, "scale");
}
BigDecimal bd = get(columnIndex).getBigDecimal();
return bd == null ? null : MathUtils.setScale(bd, scale);
} catch (Throwable e) {
throw logAndConvert(e);
}
}
代码示例来源:origin: com.h2database/com.springsource.org.h2
/**
* Returns the value of the specified column as a String.
*
* @deprecated
*
* @param columnName
* @return the value
* @throws SQLException if the column is not found or if the result set is
* closed
*/
public BigDecimal getBigDecimal(String columnName, int scale) throws SQLException {
try {
if (debug()) {
debugCode("getBigDecimal(" + StringUtils.quoteJavaString(columnName)+", "+scale+");");
}
if (scale < 0) {
throw Message.getInvalidValueException(""+scale, "scale");
}
BigDecimal bd = get(columnName).getBigDecimal();
return bd == null ? null : MathUtils.setScale(bd, scale);
} catch (Throwable e) {
throw logAndConvert(e);
}
}
内容来源于网络,如有侵权,请联系作者删除!