org.mentabean.type
Class StringType

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

public class StringType
extends Object
implements DBType<String>, SizedType


Field Summary
static int DEFAULT_SIZE
           
 
Constructor Summary
StringType()
           
 
Method Summary
 void bindToStmt(PreparedStatement stmt, int index, String value)
          Do what you have to do to bind a value to a prepared statement.
 boolean canBeNull()
           
 String getAnsiType()
           
 String getFromResultSet(ResultSet rset, int index)
          Do what you have to do to get and return this database type from a result set.
 String 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.
 StringType nullable(boolean flag)
           
 StringType size(int size)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_SIZE

public static int DEFAULT_SIZE
Constructor Detail

StringType

public StringType()
Method Detail

canBeNull

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

nullable

public StringType nullable(boolean flag)

getAnsiType

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

toString

public String toString()
Overrides:
toString in class Object

size

public StringType size(int size)

getSize

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

getFromResultSet

public String 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<String>
Parameters:
rset - The result set
index - The index in the result set
Returns:
The value from the result set
Throws:
SQLException

getFromResultSet

public String 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<String>
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<String>
Returns:
The java type of this database type.

bindToStmt

public void bindToStmt(PreparedStatement stmt,
                       int index,
                       String 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<String>
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.