stevencaswell 2003/01/26 08:52:07
Added: dbutils/src/java/org/apache/commons/dbutils/driver
SqlNullCheckedResultSet.java
Log:
created
Revision Changes Path
1.1
jakarta-commons-sandbox/dbutils/src/java/org/apache/commons/dbutils/driver/SqlNullCheckedResultSet.java
Index: SqlNullCheckedResultSet.java
===================================================================
package org.apache.commons.dbutils.driver;
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
import java.io.InputStream;
import java.io.Reader;
import java.math.BigDecimal;
import java.sql.Blob;
import java.sql.Clob;
import java.sql.Date;
import java.sql.Ref;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.Time;
import java.sql.Timestamp;
import java.util.Calendar;
import java.util.Map;
/**
* Decorates a <code>ResultSet</code> with checks for a SQL NULL value on each
* <code>getXXX</code> method. If a column value obtained by a
* <code>getXXX</code> method is not SQL NULL, the column value is returned. If
* the column value is SQL null, an alternate value is returned. The alternate
* value defaults to the Java <code>null</code> value, which can be overridden
* for instances of the class.
* <p>
* Usage example:
* <blockquote>
* <pre>
* Connection conn = getConnection(); // somehow get a connection
* Statement statement = conn.createStatement();
* ResultSet rs = statement.execute("SELECT col1, col2, FROM t1");
* if(rs != null) {
* // Wrap the result set for SQL NULL checking
* SqlNullCheckedResultSet rs = new SqlNullCheckedResultSet(rs);
* rs.setNullString("---N/A---"); // Set null string
* rs.setNullInt(-999); // Set null integer
* while(rs.next) {
* // If col1 is SQL NULL, value returned will be "---N/A---"
* String col1 = rs.getString("col1");
* // IF col2 is SQL NULL, value returned will be -999
* int col2 = rs.getInt("col2");
* ...
* }
* rs.close();
* ...
* }
* </pre>
* </blockquote>
* </p>
*
* @author <a href="[EMAIL PROTECTED]">Steven Caswell</a>
* @version $Id: SqlNullCheckedResultSet.java,v 1.1 2003/01/26 16:52:07
stevencaswell Exp $
*/
public class SqlNullCheckedResultSet extends ResultSetWrapper {
private ResultSet rs = null;
private InputStream nullAsciiStream = null;
private BigDecimal nullBigDecimal = null;
private InputStream nullBinaryStream = null;
private Blob nullBlob = null;
private boolean nullBoolean = false;
private byte nullByte = (byte) 0;
private byte[] nullBytes = null;
private Reader nullCharacterStream = null;
private Clob nullClob = null;
private Date nullDate = null;
private double nullDouble = (double) 0.0;
private float nullFloat = (float) 0.0;
private int nullInt = (int) 0;
private long nullLong = 0;
private Object nullObject = null;
private Ref nullRef = null;
private short nullShort = (short) 0;
private String nullString = null;
private Time nullTime = null;
private Timestamp nullTimestamp = null;
private InputStream nullUnicodeStream = null;
/**
* Constructs a new instance of
* <code>SqlNullCheckedResultSet</code>
* to wrap the specified <code>ResultSet</code>.
*/
public SqlNullCheckedResultSet(ResultSet rs) {
super(rs);
this.rs = rs;
}
/**
* Constructs a new instance of
* <code>SqlNullCheckedResultSet</code>
* to wrap the specified <code>ResultSet</code> and <code>Statement</code>.
*/
public SqlNullCheckedResultSet(ResultSet rs, Statement st) {
super(rs, st);
this.rs = rs;
}
/**
* @see ResultSet#getAsciiStream(int param)
*/
public InputStream getAsciiStream(int param) throws SQLException
{
InputStream stream = rs.getAsciiStream(param);
return rs.wasNull() ? getNullAsciiStream() : stream;
}
/**
* @see ResultSet#getAsciiStream(String str)
*/
public InputStream getAsciiStream(String str) throws SQLException
{
InputStream stream = rs.getAsciiStream(str);
return rs.wasNull() ? getNullAsciiStream() : stream;
}
/**
* @see ResultSet#getBigDecimal(String str)
*/
public BigDecimal getBigDecimal(String str) throws SQLException
{
BigDecimal bg = rs.getBigDecimal(str);
return rs.wasNull() ? getNullBigDecimal() : bg;
}
/**
* @see ResultSet#getBigDecimal(int param)
*/
public BigDecimal getBigDecimal(int param) throws SQLException
{
BigDecimal bg = rs.getBigDecimal(param);
return rs.wasNull() ? getNullBigDecimal() : bg;
}
/**
* @see ResultSet#getBigDecimal(int param, int param1)
* @deprecated
*/
public BigDecimal getBigDecimal(int param, int param1) throws SQLException
{
BigDecimal bg = rs.getBigDecimal(param, param1);
return rs.wasNull() ? getNullBigDecimal() : bg;
}
/**
* @see ResultSet#getBigDecimal(String str, int param)
* @deprecated
*/
public BigDecimal getBigDecimal(String str, int param) throws SQLException
{
BigDecimal bg = rs.getBigDecimal(str, param);
return rs.wasNull() ? getNullBigDecimal() : bg;
}
/**
* @see ResultSet#getBinaryStream(int param)
*/
public InputStream getBinaryStream(int param) throws SQLException
{
InputStream stream = rs.getBinaryStream(param);
return rs.wasNull() ? getNullBinaryStream() : stream;
}
/**
* @see ResultSet#getBinaryStream(String str)
*/
public InputStream getBinaryStream(String str) throws SQLException
{
InputStream stream = rs.getBinaryStream(str);
return rs.wasNull() ? getNullBinaryStream() : stream;
}
/**
* @see ResultSet#getBlob(String str)
*/
public Blob getBlob(String str) throws SQLException
{
Blob blob = rs.getBlob(str);
return rs.wasNull() ? getNullBlob() : blob;
}
/**
* @see ResultSet#getBlob(int param)
*/
public Blob getBlob(int param) throws SQLException
{
Blob blob = rs.getBlob(param);
return rs.wasNull() ? getNullBlob() : blob;
}
/**
* @see ResultSet#getBoolean(String str)
*/
public boolean getBoolean(String str) throws SQLException
{
boolean bool = rs.getBoolean(str);
return rs.wasNull() ? getNullBoolean() : bool;
}
/**
* @see ResultSet#getBoolean(int param)
*/
public boolean getBoolean(int param) throws SQLException
{
boolean bool = rs.getBoolean(param);
return rs.wasNull() ? getNullBoolean() : bool;
}
/**
* @see ResultSet#getByte(int param)
*/
public byte getByte(int param) throws SQLException
{
byte aByte = rs.getByte(param);
return rs.wasNull() ? getNullByte() : aByte;
}
/**
* @see ResultSet#getByte(String str)
*/
public byte getByte(String str) throws SQLException
{
byte aByte = rs.getByte(str);
return rs.wasNull() ? getNullByte() : aByte;
}
/**
* @see ResultSet#getBytes(int param)
*/
public byte[] getBytes(int param) throws SQLException
{
byte[] bytes = rs.getBytes(param);
return rs.wasNull() ? getNullBytes() : bytes;
}
/**
* @see ResultSet#getBytes(String str)
*/
public byte[] getBytes(String str) throws SQLException
{
byte[] bytes = rs.getBytes(str);
return rs.wasNull() ? getNullBytes() : bytes;
}
/**
* @see ResultSet#getCharacterStream(int param)
*/
public Reader getCharacterStream(int param) throws SQLException
{
Reader reader = rs.getCharacterStream(param);
return rs.wasNull() ? getNullCharacterStream() : reader;
}
/**
* @see ResultSet#getCharacterStream(String str)
*/
public Reader getCharacterStream(String str) throws SQLException
{
Reader reader = rs.getCharacterStream(str);
return rs.wasNull() ? getNullCharacterStream() : reader;
}
/**
* @see ResultSet#getClob(String str)
*/
public Clob getClob(String str) throws SQLException
{
Clob clob = rs.getClob(str);
return rs.wasNull() ? getNullClob() : clob;
}
/**
* @see ResultSet#getClob(int param)
*/
public Clob getClob(int param) throws SQLException
{
Clob clob = rs.getClob(param);
return rs.wasNull() ? getNullClob() : clob;
}
/**
* @see ResultSet#getDate(int param)
*/
public Date getDate(int param) throws SQLException
{
Date date = rs.getDate(param);
return rs.wasNull() ? getNullDate() : date;
}
/**
* @see ResultSet#getDate(String str)
*/
public Date getDate(String str) throws SQLException
{
Date date = rs.getDate(str);
return rs.wasNull() ? getNullDate() : date;
}
/**
* @see ResultSet#getDate(String str, Calendar calendar)
*/
public Date getDate(String str, Calendar calendar) throws SQLException
{
Date date = rs.getDate(str, calendar);
return rs.wasNull() ? getNullDate() : date;
}
/**
* @see ResultSet#getDate(int param, Calendar calendar)
*/
public Date getDate(int param, Calendar calendar) throws SQLException
{
Date date = rs.getDate(param, calendar);
return rs.wasNull() ? getNullDate() : date;
}
/**
* @see ResultSet#getDouble(String str)
*/
public double getDouble(String str) throws SQLException
{
double aDouble = rs.getDouble(str);
return rs.wasNull() ? getNullDouble() : aDouble;
}
/**
* @see ResultSet#getDouble(int param)
*/
public double getDouble(int param) throws SQLException
{
double aDouble = rs.getDouble(param);
return rs.wasNull() ? getNullDouble() : aDouble;
}
/**
* @see ResultSet#getFloat(int param)
*/
public float getFloat(int param) throws SQLException
{
float aFloat = rs.getFloat(param);
return rs.wasNull() ? getNullFloat() : aFloat;
}
/**
* @see ResultSet#getFloat(String str)
*/
public float getFloat(String str) throws SQLException
{
float aFloat = rs.getFloat(str);
return rs.wasNull() ? getNullFloat() : aFloat;
}
/**
* @see ResultSet#getInt(int param)
*/
public int getInt(int param) throws SQLException
{
int aInt = rs.getInt(param);
return rs.wasNull() ? getNullInt() : aInt;
}
/**
* @see ResultSet#getInt(String str)
*/
public int getInt(String str) throws SQLException
{
int aInt = rs.getInt(str);
return rs.wasNull() ? getNullInt() : aInt;
}
/**
* @see ResultSet#getLong(int param)
*/
public long getLong(int param) throws SQLException
{
long aLong = rs.getLong(param);
return rs.wasNull() ? getNullLong() : aLong;
}
/**
* @see ResultSet#getLong(String str)
*/
public long getLong(String str) throws SQLException
{
long aLong = rs.getLong(str);
return rs.wasNull() ? getNullLong() : aLong;
}
/**
* @see ResultSet#getObject(String str)
*/
public Object getObject(String str) throws SQLException
{
Object aObject = rs.getObject(str);
return rs.wasNull() ? getNullObject() : aObject;
}
/**
* @see ResultSet#getObject(int param)
*/
public Object getObject(int param) throws SQLException
{
Object aObject = rs.getObject(param);
return rs.wasNull() ? getNullObject() : aObject;
}
/**
* @see ResultSet#getObject(String str, Map map)
*/
public Object getObject(String str, Map map) throws SQLException
{
Object aObject = rs.getObject(str, map);
return rs.wasNull() ? getNullObject() : aObject;
}
/**
* @see ResultSet#getObject(int param, Map map)
*/
public Object getObject(int param, Map map) throws SQLException
{
Object aObject = rs.getObject(param, map);
return rs.wasNull() ? getNullObject() : aObject;
}
/**
* @see ResultSet#getRef(String str)
*/
public Ref getRef(String str) throws SQLException
{
Ref ref = rs.getRef(str);
return rs.wasNull() ? getNullRef() : ref;
}
/**
* @see ResultSet#getRef(int param)
*/
public Ref getRef(int param) throws SQLException
{
Ref ref = rs.getRef(param);
return rs.wasNull() ? getNullRef() : ref;
}
/**
* @see ResultSet#getShort(int param)
*/
public short getShort(int param) throws SQLException
{
short aShort = rs.getShort(param);
return rs.wasNull() ? getNullShort() : aShort;
}
/**
* @see ResultSet#getShort(String str)
*/
public short getShort(String str) throws SQLException
{
short aShort = rs.getShort(str);
return rs.wasNull() ? getNullShort() : aShort;
}
/**
* @see ResultSet#getString(String str)
*/
public String getString(String str) throws SQLException
{
String string = rs.getString(str);
return rs.wasNull() ? getNullString() : string;
}
/**
* @see ResultSet#getString(int param)
*/
public String getString(int param) throws SQLException
{
String string = rs.getString(param);
return rs.wasNull() ? getNullString() : string;
}
/**
* @see ResultSet#getTime(int param)
*/
public Time getTime(int param) throws SQLException
{
Time time = rs.getTime(param);
return rs.wasNull() ? getNullTime() : time;
}
/**
* @see ResultSet#getTime(String str)
*/
public Time getTime(String str) throws SQLException
{
Time time = rs.getTime(str);
return rs.wasNull() ? getNullTime() : time;
}
/**
* @see ResultSet#getTime(String str, Calendar calendar)
*/
public Time getTime(String str, Calendar calendar) throws SQLException
{
Time time = rs.getTime(str, calendar);
return rs.wasNull() ? getNullTime() : time;
}
/**
* @see ResultSet#getTime(int param, Calendar calendar)
*/
public Time getTime(int param, Calendar calendar) throws SQLException
{
Time time = rs.getTime(param, calendar);
return rs.wasNull() ? getNullTime() : time;
}
/**
* @see ResultSet#getTimestamp(String str)
*/
public Timestamp getTimestamp(String str) throws SQLException
{
Timestamp timestamp = rs.getTimestamp(str);
return rs.wasNull() ? getNullTimestamp() : timestamp;
}
/**
* @see ResultSet#getTimestamp(int param)
*/
public Timestamp getTimestamp(int param) throws SQLException
{
Timestamp timestamp = rs.getTimestamp(param);
return rs.wasNull() ? getNullTimestamp() : timestamp;
}
/**
* @see ResultSet#getTimestamp(int param, Calendar calendar)
*/
public Timestamp getTimestamp(int param, Calendar calendar) throws SQLException
{
Timestamp timestamp = rs.getTimestamp(param, calendar);
return rs.wasNull() ? getNullTimestamp() : timestamp;
}
/**
* @see ResultSet#getTimestamp(String str, Calendar calendar)
*/
public Timestamp getTimestamp(String str, Calendar calendar) throws SQLException
{
Timestamp timestamp = rs.getTimestamp(str, calendar);
return rs.wasNull() ? getNullTimestamp() : timestamp;
}
/**
* @see ResultSet#getUnicodeStream(int param)
* @deprecated
*/
public InputStream getUnicodeStream(int param) throws SQLException
{
InputStream stream = rs.getUnicodeStream(param);
return rs.wasNull() ? getNullUnicodeStream() : stream;
}
/**
* @see ResultSet#getUnicodeStream(String str)
* @deprecated
*/
public InputStream getUnicodeStream(String str) throws SQLException
{
InputStream stream = rs.getUnicodeStream(str);
return rs.wasNull() ? getNullUnicodeStream() : stream;
}
/**
* Returns the value when a SQL null is encountered as the result of
* invoking a <code>getAsciiStream</code> method.
*
* @return the value
*/
public InputStream getNullAsciiStream()
{
return this.nullAsciiStream;
}
/**
* Returns the value when a SQL null is encountered as the result of
* invoking a <code>getBigDecimal</code> method.
*
* @return the value
*/
public BigDecimal getNullBigDecimal()
{
return this.nullBigDecimal;
}
/**
* Returns the value when a SQL null is encountered as the result of
* invoking a <code>getBinaryStream</code> method.
*
* @return the value
*/
public InputStream getNullBinaryStream()
{
return this.nullBinaryStream;
}
/**
* Returns the value when a SQL null is encountered as the result of
* invoking a <code>getBlob</code> method.
*
* @return the value
*/
public Blob getNullBlob()
{
return this.nullBlob;
}
/**
* Returns the value when a SQL null is encountered as the result of
* invoking a <code>getBoolean</code> method.
*
* @return the value
*/
public boolean getNullBoolean()
{
return this.nullBoolean;
}
/**
* Returns the value when a SQL null is encountered as the result of
* invoking a <code>getByte</code> method.
*
* @return the value
*/
public byte getNullByte()
{
return this.nullByte;
}
/**
* Returns the value when a SQL null is encountered as the result of
* invoking a <code>getBytes</code> method.
*
* @return the value
*/
public byte[] getNullBytes()
{
return this.nullBytes;
}
/**
* Returns the value when a SQL null is encountered as the result of
* invoking a <code>getCharacterStream</code> method.
*
* @return the value
*/
public Reader getNullCharacterStream()
{
return this.nullCharacterStream;
}
/**
* Returns the value when a SQL null is encountered as the result of
* invoking a <code>getClob</code> method.
*
* @return the value
*/
public Clob getNullClob()
{
return this.nullClob;
}
/**
* Returns the value when a SQL null is encountered as the result of
* invoking a <code>getDate</code> method.
*
* @return the value
*/
public Date getNullDate()
{
return this.nullDate;
}
/**
* Returns the value when a SQL null is encountered as the result of
* invoking a <code>getDouble</code> method.
*
* @return the value
*/
public double getNullDouble()
{
return this.nullDouble;
}
/**
* Returns the value when a SQL null is encountered as the result of
* invoking a <code>getFloat</code> method.
*
* @return the value
*/
public float getNullFloat()
{
return this.nullFloat;
}
/**
* Returns the value when a SQL null is encountered as the result of
* invoking a <code>getInt</code> method.
*
* @return the value
*/
public int getNullInt()
{
return this.nullInt;
}
/**
* Returns the value when a SQL null is encountered as the result of
* invoking a <code>getLong</code> method.
*
* @return the value
*/
public long getNullLong()
{
return this.nullLong;
}
/**
* Returns the value when a SQL null is encountered as the result of
* invoking a <code>getObject</code> method.
*
* @return the value
*/
public Object getNullObject()
{
return this.nullObject;
}
/**
* Returns the value when a SQL null is encountered as the result of
* invoking a <code>getRef</code> method.
*
* @return the value
*/
public Ref getNullRef()
{
return this.nullRef;
}
/**
* Returns the value when a SQL null is encountered as the result of
* invoking a <code>getShort</code> method.
*
* @return the value
*/
public short getNullShort()
{
return this.nullShort;
}
/**
* Returns the value when a SQL null is encountered as the result of
* invoking a <code>getString</code> method.
*
* @return the value
*/
public String getNullString()
{
return this.nullString;
}
/**
* Returns the value when a SQL null is encountered as the result of
* invoking a <code>getTime</code> method.
*
* @return the value
*/
public Time getNullTime()
{
return this.nullTime;
}
/**
* Returns the value when a SQL null is encountered as the result of
* invoking a <code>getTimestamp</code> method.
*
* @return the value
*/
public Timestamp getNullTimestamp()
{
return this.nullTimestamp;
}
/**
* Returns the value when a SQL null is encountered as the result of
* invoking a <code>getUnicodeStream</code> method.
*
* @return the value
*/
public InputStream getNullUnicodeStream()
{
return this.nullUnicodeStream;
}
/**
* Sets the value to return when a SQL null is encountered as the result of
* invoking a <code>getAsciiStream</code> method.
*
* @param nullAsciiStream the value
*/
public void setNullAsciiStream(InputStream nullAsciiStream)
{
this.nullAsciiStream = nullAsciiStream;
}
/**
* Sets the value to return when a SQL null is encountered as the result of
* invoking a <code>getBigDecimal</code> method.
*
* @param nullBigDecimal the value
*/
public void setNullBigDecimal(BigDecimal nullBigDecimal)
{
this.nullBigDecimal = nullBigDecimal;
}
/**
* Sets the value to return when a SQL null is encountered as the result of
* invoking a <code>getBinaryStream</code> method.
*
* @param nullBinaryStream the value
*/
public void setNullBinaryStream(InputStream nullBinaryStream)
{
this.nullBinaryStream = nullBinaryStream;
}
/**
* Sets the value to return when a SQL null is encountered as the result of
* invoking a <code>getBlob</code> method.
*
* @param nullBlob the value
*/
public void setNullBlob(Blob nullBlob)
{
this.nullBlob = nullBlob;
}
/**
* Sets the value to return when a SQL null is encountered as the result of
* invoking a <code>getBoolean</code> method.
*
* @param nullBoolean the value
*/
public void setNullBoolean(boolean nullBoolean)
{
this.nullBoolean = nullBoolean;
}
/**
* Sets the value to return when a SQL null is encountered as the result of
* invoking a <code>getByte</code> method.
*
* @param nullByte the value
*/
public void setNullByte(byte nullByte)
{
this.nullByte = nullByte;
}
/**
* Sets the value to return when a SQL null is encountered as the result of
* invoking a <code>getBytes</code> method.
*
* @param nullBytes the value
*/
public void setNullBytes(byte[] nullBytes)
{
this.nullBytes = nullBytes;
}
/**
* Sets the value to return when a SQL null is encountered as the result of
* invoking a <code>getCharacterStream</code> method.
*
* @param nullCharacterStream the value
*/
public void setNullCharacterStream(Reader nullCharacterStream)
{
this.nullCharacterStream = nullCharacterStream;
}
/**
* Sets the value to return when a SQL null is encountered as the result of
* invoking a <code>getClob</code> method.
*
* @param nullClob the value
*/
public void setNullClob(Clob nullClob)
{
this.nullClob = nullClob;
}
/**
* Sets the value to return when a SQL null is encountered as the result of
* invoking a <code>getDate</code> method.
*
* @param nullDate the value
*/
public void setNullDate(Date nullDate)
{
this.nullDate = nullDate;
}
/**
* Sets the value to return when a SQL null is encountered as the result of
* invoking a <code>getDouble</code> method.
*
* @param nullDouble the value
*/
public void setNullDouble(double nullDouble)
{
this.nullDouble = nullDouble;
}
/**
* Sets the value to return when a SQL null is encountered as the result of
* invoking a <code>getFloat</code> method.
*
* @param nullFloat the value
*/
public void setNullFloat(float nullFloat)
{
this.nullFloat = nullFloat;
}
/**
* Sets the value to return when a SQL null is encountered as the result of
* invoking a <code>getInt</code> method.
*
* @param nullInt the value
*/
public void setNullInt(int nullInt)
{
this.nullInt = nullInt;
}
/**
* Sets the value to return when a SQL null is encountered as the result of
* invoking a <code>getLong</code> method.
*
* @param nullLong the value
*/
public void setNullLong(long nullLong)
{
this.nullLong = nullLong;
}
/**
* Sets the value to return when a SQL null is encountered as the result of
* invoking a <code>getObject</code> method.
*
* @param nullObject the value
*/
public void setNullObject(Object nullObject)
{
this.nullObject = nullObject;
}
/**
* Sets the value to return when a SQL null is encountered as the result of
* invoking a <code>getRef</code> method.
*
* @param nullRef the value
*/
public void setNullRef(Ref nullRef)
{
this.nullRef = nullRef;
}
/**
* Sets the value to return when a SQL null is encountered as the result of
* invoking a <code>getShort</code> method.
*
* @param nullShort the value
*/
public void setNullShort(short nullShort)
{
this.nullShort = nullShort;
}
/**
* Sets the value to return when a SQL null is encountered as the result of
* invoking a <code>getString</code> method.
*
* @param nullString the value
*/
public void setNullString(String nullString)
{
this.nullString = nullString;
}
/**
* Sets the value to return when a SQL null is encountered as the result of
* invoking a <code>getTime</code> method.
*
* @param nullTime the value
*/
public void setNullTime(Time nullTime)
{
this.nullTime = nullTime;
}
/**
* Sets the value to return when a SQL null is encountered as the result of
* invoking a <code>getTimestamp</code> method.
*
* @param nullTimestamp the value
*/
public void setNullTimestamp(Timestamp nullTimestamp)
{
this.nullTimestamp = nullTimestamp;
}
/**
* Sets the value to return when a SQL null is encountered as the result of
* invoking a <code>getUnicodeStream</code> method.
*
* @param nullUnicodeStream the value
*/
public void setNullUnicodeStream(InputStream nullUnicodeStream)
{
this.nullUnicodeStream = nullUnicodeStream;
}
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>