gistoolkit.datasources
Interface SQLConverter

All Known Implementing Classes:
SimpleSQLConverter

public interface SQLConverter

Class to convert java types and AttributeTypes to SQL for a particular database.


Method Summary
 AttributeType getAttributeType(java.sql.ResultSetMetaData inrmet, int inIndex)
          Convert the given ODBC type of data to the GISToolkit type of data.
 java.lang.String toSQL(java.lang.Object inObject, AttributeType inAttributeType, int inJDBCType)
          Take the given type, of the given value, and convert it to the sql string needed for insertion into the database.
 java.lang.String toSQLDate(java.util.Date inDate, AttributeType inAttributeType)
          Convert a java date into the JDBC date representaion for this database.
 java.lang.String toSQLDate(java.lang.Object inObject, AttributeType inAttributeType)
          Convert the object to the JDBC Date representaion for the database.
 java.lang.String toSQLDate(java.lang.String inDate, AttributeType inAttributeType)
          Convert a string into the JDBC date representaion for this database.
 java.lang.String toSQLDecimal(java.lang.Object inDecimal, AttributeType inAttributeType)
          Convert an object into the JDBC decimal representaion for this database.
 java.lang.String toSQLInteger(java.lang.Object inInteger, AttributeType inAttributeType)
          Convert an object into the JDBC Integer representaion for this database.
 java.lang.String toSQLString(java.lang.Object inObject, AttributeType inAttributeType)
          Convert the object to a JDBC Character representation for the database.
 

Method Detail

getAttributeType

public AttributeType getAttributeType(java.sql.ResultSetMetaData inrmet,
                                      int inIndex)
                               throws java.sql.SQLException
Convert the given ODBC type of data to the GISToolkit type of data.

Throws:
java.sql.SQLException

toSQL

public java.lang.String toSQL(java.lang.Object inObject,
                              AttributeType inAttributeType,
                              int inJDBCType)
Take the given type, of the given value, and convert it to the sql string needed for insertion into the database. In the case of strings, this routine will add the appostraphies as needed.


toSQLString

public java.lang.String toSQLString(java.lang.Object inObject,
                                    AttributeType inAttributeType)
Convert the object to a JDBC Character representation for the database. It will add any delimiting characters like the beginning and ending appostraphies, as well as converting the embedded appostraphies to duplicate appostraphies.


toSQLDate

public java.lang.String toSQLDate(java.lang.Object inObject,
                                  AttributeType inAttributeType)
Convert the object to the JDBC Date representaion for the database. It will add any delimited characters, or functions to the database like, to_Date(format, date string) stuff.


toSQLDate

public java.lang.String toSQLDate(java.util.Date inDate,
                                  AttributeType inAttributeType)
Convert a java date into the JDBC date representaion for this database.


toSQLDate

public java.lang.String toSQLDate(java.lang.String inDate,
                                  AttributeType inAttributeType)
Convert a string into the JDBC date representaion for this database.


toSQLInteger

public java.lang.String toSQLInteger(java.lang.Object inInteger,
                                     AttributeType inAttributeType)
Convert an object into the JDBC Integer representaion for this database.


toSQLDecimal

public java.lang.String toSQLDecimal(java.lang.Object inDecimal,
                                     AttributeType inAttributeType)
Convert an object into the JDBC decimal representaion for this database.