applied patch submitted by Florian (mailing-list@urbanet.ch) for BigDecimal support

This commit is contained in:
Barry Lind 2002-03-26 06:33:21 +00:00
parent ef7d791074
commit da631e931f
3 changed files with 11 additions and 2 deletions

View File

@ -243,7 +243,12 @@ public class PreparedStatement extends Statement implements java.sql.PreparedSta
*/ */
public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException
{ {
set(parameterIndex, x.toString()); if (x == null)
setNull(parameterIndex, Types.OTHER);
else
{
set(parameterIndex, x.toString());
}
} }
/* /*

View File

@ -140,7 +140,7 @@ public class Array implements java.sql.Array
case Types.NUMERIC: case Types.NUMERIC:
retVal = new BigDecimal[ count ]; retVal = new BigDecimal[ count ];
for ( ; count > 0; count-- ) for ( ; count > 0; count-- )
((BigDecimal[])retVal)[i] = ResultSet.toBigDecimal( arrayContents[(int)index++], 0 ); ((BigDecimal[])retVal)[i++] = ResultSet.toBigDecimal( arrayContents[(int)index++], 0 );
break; break;
case Types.REAL: case Types.REAL:
retVal = new float[ count ]; retVal = new float[ count ];

View File

@ -251,7 +251,11 @@ public class PreparedStatement extends Statement implements java.sql.PreparedSta
*/ */
public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException
{ {
if (x == null) {
setNull(parameterIndex, Types.OTHER);
} else {
set(parameterIndex, x.toString()); set(parameterIndex, x.toString());
}
} }
/* /*