mirror of
https://github.com/postgres/postgres.git
synced 2025-05-06 19:59:18 +03:00
This patch fixes a bug which occurs when setObject(1,obj) is called and obj
is of type Object, and is null Dave Cramer
This commit is contained in:
parent
37b006e074
commit
7934c93cbe
@ -455,6 +455,10 @@ public class PreparedStatement extends Statement implements java.sql.PreparedSta
|
||||
*/
|
||||
public void setObject(int parameterIndex, Object x, int targetSqlType, int scale) throws SQLException
|
||||
{
|
||||
if (x == null){
|
||||
setNull(parameterIndex,Types.OTHER);
|
||||
return;
|
||||
}
|
||||
switch (targetSqlType)
|
||||
{
|
||||
case Types.TINYINT:
|
||||
@ -506,6 +510,10 @@ public class PreparedStatement extends Statement implements java.sql.PreparedSta
|
||||
*/
|
||||
public void setObject(int parameterIndex, Object x) throws SQLException
|
||||
{
|
||||
if (x == null){
|
||||
setNull(parameterIndex,Types.OTHER);
|
||||
return;
|
||||
}
|
||||
if (x instanceof String)
|
||||
setString(parameterIndex, (String)x);
|
||||
else if (x instanceof BigDecimal)
|
||||
|
@ -515,6 +515,10 @@ public class PreparedStatement extends Statement implements java.sql.PreparedSta
|
||||
*/
|
||||
public void setObject(int parameterIndex, Object x, int targetSqlType, int scale) throws SQLException
|
||||
{
|
||||
if (x == null){
|
||||
setNull(parameterIndex,Types.OTHER);
|
||||
return;
|
||||
}
|
||||
switch (targetSqlType)
|
||||
{
|
||||
case Types.TINYINT:
|
||||
@ -566,6 +570,10 @@ public class PreparedStatement extends Statement implements java.sql.PreparedSta
|
||||
*/
|
||||
public void setObject(int parameterIndex, Object x) throws SQLException
|
||||
{
|
||||
if (x == null){
|
||||
setNull(parameterIndex,Types.OTHER);
|
||||
return;
|
||||
}
|
||||
if (x instanceof String)
|
||||
setString(parameterIndex, (String)x);
|
||||
else if (x instanceof BigDecimal)
|
||||
|
Loading…
x
Reference in New Issue
Block a user