Commit da631e93 authored by Barry Lind's avatar Barry Lind

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

parent ef7d7910
...@@ -242,9 +242,14 @@ public class PreparedStatement extends Statement implements java.sql.PreparedSta ...@@ -242,9 +242,14 @@ public class PreparedStatement extends Statement implements java.sql.PreparedSta
* @exception SQLException if a database access error occurs * @exception SQLException if a database access error occurs
*/ */
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());
} }
}
/* /*
* Set a parameter to a Java String value. The driver converts this * Set a parameter to a Java String value. The driver converts this
......
...@@ -140,7 +140,7 @@ public class Array implements java.sql.Array ...@@ -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 ];
......
...@@ -251,8 +251,12 @@ public class PreparedStatement extends Statement implements java.sql.PreparedSta ...@@ -251,8 +251,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
{ {
if (x == null) {
setNull(parameterIndex, Types.OTHER);
} else {
set(parameterIndex, x.toString()); set(parameterIndex, x.toString());
} }
}
/* /*
* Set a parameter to a Java String value. The driver converts this * Set a parameter to a Java String value. The driver converts this
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment