net.sourceforge.backpedal.impl.db
Class AbstractBindVariable

java.lang.Object
  |
  +--net.sourceforge.backpedal.impl.db.AbstractBindVariable
All Implemented Interfaces:
BindVariable, Cloneable
Direct Known Subclasses:
BooleanBindVariable, CharBindVariable, DateBindVariable, IntegerBindVariable, NullBindVariable, StringBindVariable, TimestampBindVariable

public abstract class AbstractBindVariable
extends Object
implements BindVariable


Constructor Summary
AbstractBindVariable(int index, Object valueAsObject, String columnName)
           
 
Method Summary
 Object clone()
           
 String getColumnName()
          Return the name of the column I represent.
 int getIndex()
          Return the index of my position in the list of bind variables to which I belong.
abstract  int getSqlType()
          Return the value from java.sql.Types that I represent.
 Object getValue()
          Return the value I represent i.e.
 boolean isNull()
           
 void setColumnName(String columnName)
           
 void setIndex(int index)
           
 void setInto(PreparedStatement preparedStatement)
          Call the relevant set() method on preparedStatement with index getIndex().
 void setValue(Object value)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sourceforge.backpedal.api.db.BindVariable
setInto
 

Constructor Detail

AbstractBindVariable

public AbstractBindVariable(int index,
                            Object valueAsObject,
                            String columnName)
Method Detail

getIndex

public int getIndex()
Description copied from interface: BindVariable
Return the index of my position in the list of bind variables to which I belong.

Specified by:
getIndex in interface BindVariable

getValue

public Object getValue()
Description copied from interface: BindVariable
Return the value I represent i.e. that which will be passed to the set() method on the prepared statement passed to setInto().

Specified by:
getValue in interface BindVariable

getSqlType

public abstract int getSqlType()
Description copied from interface: BindVariable
Return the value from java.sql.Types that I represent.

Specified by:
getSqlType in interface BindVariable

setIndex

public void setIndex(int index)
Specified by:
setIndex in interface BindVariable

setValue

public void setValue(Object value)
Specified by:
setValue in interface BindVariable

setColumnName

public void setColumnName(String columnName)
Specified by:
setColumnName in interface BindVariable

clone

public Object clone()
             throws CloneNotSupportedException
Specified by:
clone in interface BindVariable
Overrides:
clone in class Object
CloneNotSupportedException

isNull

public boolean isNull()
Specified by:
isNull in interface BindVariable

getColumnName

public String getColumnName()
Description copied from interface: BindVariable
Return the name of the column I represent. Might be null is not known.

Specified by:
getColumnName in interface BindVariable

toString

public String toString()
Overrides:
toString in class Object

setInto

public void setInto(PreparedStatement preparedStatement)
             throws SQLException
Description copied from interface: BindVariable
Call the relevant set() method on preparedStatement with index getIndex().

Specified by:
setInto in interface BindVariable
SQLException


Copyright © Sourceforge. All Rights Reserved.