org.melati.poem
Interface SQLType

All Known Subinterfaces:
SQLPoemType
All Known Implementing Classes:
AtomPoemType, BasePoemType, BigDecimalPoemType, BinaryPoemType, BooleanPoemType, ColumnTypePoemType, DatePoemType, DeletedPoemType, DisplayLevelPoemType, DoublePoemType, FixedPointAtomPoemType, IndexPoemType, IntegerPoemType, IntegrityFixPoemType, LongPoemType, MSAccess.MSAccessStringPoemType, MySQL.BlobPoemType, MySQL.MySQLBooleanPoemType, MySQL.MySQLStringPoemType, Oracle.OracleBooleanPoemType, Oracle.OracleStringPoemType, PasswordPoemType, ReferencePoemType, RestrictedReferencePoemType, SearchabilityPoemType, SizedAtomPoemType, SQLServer.SQLServerBooleanPoemType, StringPoemType, TimestampPoemType, TroidPoemType

public interface SQLType

A native SQL Field datatype.

Author:
WilliamC At paneris.org

Method Summary
 java.lang.Object getRaw(java.sql.ResultSet rs, int col)
          Return an object as delivered by the database.
 java.lang.String quotedRaw(java.lang.Object raw)
          Quoting a raw value, if appropriate, for the Dbms.
 void setRaw(java.sql.PreparedStatement ps, int col, java.lang.Object cooked)
          Set a column of a PreparedStatement to the passed in value.
 java.lang.String sqlDefaultValue(Dbms dbms)
          Used to set a not null value when creating a non nullable column.
 java.lang.String sqlDefinition(Dbms dbms)
          SQL type definition with nullability.
 int sqlTypeCode()
           
 java.lang.String sqlTypeDefinition(Dbms dbms)
          SQL type definition without nullability.
 

Method Detail

sqlTypeCode

int sqlTypeCode()
Returns:
The SQL92 ANSI code for this type.

sqlDefinition

java.lang.String sqlDefinition(Dbms dbms)
SQL type definition with nullability. eg: STRING NOT NULL

Parameters:
dbms - the DBMS
Returns:
the DBMS specific SQL snippet

sqlDefaultValue

java.lang.String sqlDefaultValue(Dbms dbms)
Used to set a not null value when creating a non nullable column.

Parameters:
dbms - the dbms the value is suitable for
Returns:
a String suitable for substitution in UPDATE table SET field = ?

sqlTypeDefinition

java.lang.String sqlTypeDefinition(Dbms dbms)
SQL type definition without nullability. eg: STRING

Parameters:
dbms - the DBMS
Returns:
the DBMS specific SQL snippet

quotedRaw

java.lang.String quotedRaw(java.lang.Object raw)
Quoting a raw value, if appropriate, for the Dbms.

numbers and booleans are not quoted for most dbms'.

Parameters:
raw - sql value
Returns:
the raw value with quotes if appropriate for the dbms

getRaw

java.lang.Object getRaw(java.sql.ResultSet rs,
                        int col)
                        throws TypeMismatchPoemException,
                               ValidationPoemException,
                               ParsingPoemException
Return an object as delivered by the database.

Parameters:
rs - the Resultset containing the value
col - the column withing the ResultSet to read
Returns:
the value as an Object
Throws:
TypeMismatchPoemException
ValidationPoemException
ParsingPoemException

setRaw

void setRaw(java.sql.PreparedStatement ps,
            int col,
            java.lang.Object cooked)
            throws TypeMismatchPoemException
Set a column of a PreparedStatement to the passed in value.

Parameters:
ps - the Prepared Statement to modify
col - the column within the PreparedStatement
cooked - the value to set
Throws:
TypeMismatchPoemException


Copyright © 2000-2009 PanEris. All Rights Reserved.