* @param rs ResultSet from DatabaseMetaData.getColumns()
* @return column info
*/
public RDBMSColumnInfo newRDBMSColumnInfo(ResultSet rs)
{
RDBMSColumnInfo info = new RDBMSColumnInfo(rs);
String typeName = info.getTypeName();
int dataType = -1;
if (typeName == null)
{
dataType = Types.NULL;
}
else if (typeName.equals("ROWID"))
{
dataType = Types.INTEGER;
}
else if (typeName.equals("NUMBER") || typeName.equals("VARNUM"))
{
dataType = Types.NUMERIC;
}
else if (typeName.equals("VARCHAR2"))
{
dataType = Types.VARCHAR;
}
else if (typeName.equals("CHAR"))
{
dataType = Types.CHAR;
}
else if (typeName.equals("DATE"))
{
// should this be TIMESTAMP instead of DATE ??
dataType = Types.DATE;
}
else if (typeName.equals("CLOB") || typeName.equals("NCLOB"))
{
dataType = Types.CLOB;
}
else if (typeName.equals("BLOB"))
{
dataType = Types.BLOB;
}
else if (typeName.equals("LONG"))
{
dataType = Types.LONGVARCHAR;
}
else if (typeName.equals("LONG RAW"))
{
dataType = Types.LONGVARBINARY;
}
else if (typeName.equals("RAW"))
{
dataType = Types.VARBINARY;
}
else if (typeName.startsWith("TIMESTAMP"))
{
dataType = Types.TIMESTAMP;
}
else if (typeName.equals("FLOAT"))
{
dataType = Types.FLOAT;
}
else
{
NucleusLogger.DATASTORE.warn(LOCALISER.msg("020191", typeName));
dataType = Types.OTHER;
}
info.setDataType((short)dataType);
return info;
}