com.buzzsurf.sql
Class OutParameter

java.lang.Object
  extended by com.buzzsurf.sql.OutParameter
Direct Known Subclasses:
InOutParameter

public class OutParameter
extends java.lang.Object

An object that models a stored procedure OUT parameter.

See com.buzzsurf.sql.StoredProcedure for usage information.

Author:
Paul Cowan (www.buzzsurf.com/sql)
See Also:
StoredProcedure, Types

Field Summary
protected  int outSqlType
           
protected  java.lang.Object outValue
           
 
Constructor Summary
OutParameter()
          Empty constructor provided for convenience
OutParameter(int outSqlType)
          Construct a stored procedure OUT parameter of the specified type
 
Method Summary
 boolean getBoolean()
           
 byte getByte()
           
 byte[] getBytes()
           
 java.util.Calendar getCalendar()
           
 java.util.Date getDate()
           
 double getDouble()
           
 float getFloat()
           
 int getInt()
           
 long getLong()
           
 java.lang.Object getObject()
           
 int getOutSqlType()
           
 short getShort()
           
 java.lang.String getString()
           
 void setCalendar(int columnIndex, java.util.Calendar c)
          Set the java.util.Calendar to the value of the out parameter value from the stored procedure if it is an instanceof java.sql.Timestamp
 void setOutSqlType(int outSqlType)
          Set the out parameter SQL type from java.sql.Type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

outSqlType

protected int outSqlType

outValue

protected java.lang.Object outValue
Constructor Detail

OutParameter

public OutParameter()
Empty constructor provided for convenience


OutParameter

public OutParameter(int outSqlType)
Construct a stored procedure OUT parameter of the specified type

Parameters:
outSqlType - A java.sql.Type constant int
Method Detail

setOutSqlType

public void setOutSqlType(int outSqlType)
Set the out parameter SQL type from java.sql.Type

Parameters:
outSqlType - A java.sql.Type constant int

getOutSqlType

public int getOutSqlType()
Returns:
The java.sql.Type of the out parameter.

getObject

public java.lang.Object getObject()
Returns:
The out parameter value from the stored procedure in it's native format.

getString

public java.lang.String getString()
Returns:
The out parameter value from the stored procedure in String format, or null.

getBoolean

public boolean getBoolean()
Returns:
The out parameter value from the stored procedure as a boolean, or false if it can not be converted to a boolean.

getByte

public byte getByte()
Returns:
The out parameter value from the stored procedure as a byte, or 0 if it can not be converted to a byte.

getShort

public short getShort()
Returns:
The out parameter value from the stored procedure as a short, or 0 if it can not be converted to a short.

getInt

public int getInt()
Returns:
The out parameter value from the stored procedure as an int, or 0 if it can not be converted to an int.

getLong

public long getLong()
Returns:
The out parameter value from the stored procedure as a long, or 0 if it can not be converted to a long.

getFloat

public float getFloat()
Returns:
The out parameter value from the stored procedure as a float, or 0 if it can not be converted to a float.

getDouble

public double getDouble()
Returns:
The out parameter value from the stored procedure as a double, or 0 if it can not be converted to a double.

getDate

public java.util.Date getDate()
Returns:
The out parameter value from the stored procedure as a java.util.Date, or null if it is not an instanceof java.util.Date

getCalendar

public java.util.Calendar getCalendar()
Returns:
The out parameter value from the stored procedure as a java.util.Calendar, or null if it is not an instanceof java.sql.Timestamp

setCalendar

public void setCalendar(int columnIndex,
                        java.util.Calendar c)
Set the java.util.Calendar to the value of the out parameter value from the stored procedure if it is an instanceof java.sql.Timestamp


getBytes

public byte[] getBytes()
Returns:
The out parameter value from the stored procedure as a byte array, or null if it can not an instanceof byte array.