public class SQLTypes
extends java.lang.Object
SQL format can be slightly different between different databases. For example, MS Access allows you to put column names in "" which then enables you to use otherwise reserved words. MySQL on the other hand, will not let you do this.
This base class contains some default behaviours, but expect them to be overridden in many instances.
Types
Constructor and Description |
---|
SQLTypes() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
formatColumnName(java.lang.String columnName)
Format the column name.
|
int |
systemSqlType(int sqlType)
Some SQL types are unavailable on some systems, so qutomatically
swap them for something else.
|
java.lang.String |
typeToString(int sqlType,
int length)
Converts a numeric SQL type and length to a text string
that can be used in SQL statements.
|
java.lang.String |
typeToString(int sqlType,
int length,
boolean counter) |
java.lang.String |
typeToString(PamTableItem tableItem) |
public java.lang.String typeToString(PamTableItem tableItem)
public java.lang.String typeToString(int sqlType, int length)
sqlType
- SQL type as defined in java.sql.Typeslength
- length of character and text fieldspublic java.lang.String typeToString(int sqlType, int length, boolean counter)
public java.lang.String formatColumnName(java.lang.String columnName)
columnName
- public int systemSqlType(int sqlType)
sqlType
-