org.mentabean.type
Class BooleanStringType

java.lang.Object
  extended by org.mentabean.type.BooleanStringType
All Implemented Interfaces:
DBType<Boolean>, SizedType

public class BooleanStringType
extends Object
implements DBType<Boolean>, SizedType


Constructor Summary
BooleanStringType()
           
BooleanStringType(String sTrue, String sFalse)
           
 
Method Summary
 void bindToStmt(PreparedStatement stmt, int index, Boolean value)
          Do what you have to do to bind a value to a prepared statement.
 boolean canBeNull()
           
 boolean equals(Object obj)
           
 String getAnsiType()
           
protected  boolean getBooleanValue(String s)
           
 Boolean getFromResultSet(ResultSet rset, int index)
          Do what you have to do to get and return this database type from a result set.
 Boolean getFromResultSet(ResultSet rset, String field)
          Do what you have to do to get and return this database type from a result set.
 int getSize()
           
 Class<? extends Object> getTypeClass()
          Return the java type representing this database type.
 BooleanStringType nullable(boolean flag)
           
 BooleanStringType size(int size)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BooleanStringType

public BooleanStringType()

BooleanStringType

public BooleanStringType(String sTrue,
                         String sFalse)
Method Detail

canBeNull

public boolean canBeNull()
Specified by:
canBeNull in interface DBType<Boolean>

getAnsiType

public String getAnsiType()
Specified by:
getAnsiType in interface DBType<Boolean>

nullable

public BooleanStringType nullable(boolean flag)

size

public BooleanStringType size(int size)

getSize

public int getSize()
Specified by:
getSize in interface SizedType

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object

getBooleanValue

protected boolean getBooleanValue(String s)
                           throws SQLException
Throws:
SQLException

getFromResultSet

public Boolean getFromResultSet(ResultSet rset,
                                int index)
                         throws SQLException
Description copied from interface: DBType
Do what you have to do to get and return this database type from a result set.

Specified by:
getFromResultSet in interface DBType<Boolean>
Parameters:
rset - The result set
index - The index in the result set
Returns:
The value from the result set
Throws:
SQLException

getFromResultSet

public Boolean getFromResultSet(ResultSet rset,
                                String field)
                         throws SQLException
Description copied from interface: DBType
Do what you have to do to get and return this database type from a result set.

Specified by:
getFromResultSet in interface DBType<Boolean>
Parameters:
rset - The result set
field - The name of the field in the result set
Returns:
The value from the result set
Throws:
SQLException

getTypeClass

public Class<? extends Object> getTypeClass()
Description copied from interface: DBType
Return the java type representing this database type.

Specified by:
getTypeClass in interface DBType<Boolean>
Returns:
The java type of this database type.

bindToStmt

public void bindToStmt(PreparedStatement stmt,
                       int index,
                       Boolean value)
                throws SQLException
Description copied from interface: DBType
Do what you have to do to bind a value to a prepared statement.

Specified by:
bindToStmt in interface DBType<Boolean>
Parameters:
stmt - The prepared statement
index - The index in the prepared statement
value - The value to be bound to the prepared statement
Throws:
SQLException


Copyright © 2012. All Rights Reserved.