Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion src/main/java/org/apache/ddlutils/model/TypeMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,20 @@ public abstract class TypeMap
public static final String VARBINARY = "VARBINARY";
/** The string representation of the {@link java.sql.Types#VARCHAR} constant. */
public static final String VARCHAR = "VARCHAR";

/** The string representation of the {@link java.sql.Types#NVARCHAR} constant. */
public static final String NVARCHAR = "NVARCHAR";
/** The string representation of the {@link java.sql.Types#NCHAR} constant. */
public static final String NCHAR = "NCHAR";
/** The string representation of the {@link java.sql.Types#NVARCHAR} constant. */
public static final String LONGNVARCHAR = "NVARCHAR";
/** The string representation of the {@link java.sql.Types#NCLOB} constant. */
public static final String NCLOB = "NCLOB";
/** The string representation of the {@link java.sql.Types#ROWID} constant. */
public static final String ROWID = "ROWID";
/** The string representation of the {@link java.sql.Types#SQLXML} constant. */
public static final String SQLXML = "SQLXML";
/** The string representation of the {@link java.sql.Types#SQLXML} constant. */

/** Maps type names to the corresponding {@link java.sql.Types} constants. */
private static HashMap _typeNameToTypeCode = new HashMap();
/** Maps {@link java.sql.Types} type code constants to the corresponding type names. */
Expand All @@ -110,6 +123,7 @@ public abstract class TypeMap
registerJdbcType(Types.BLOB, BLOB, JdbcTypeCategoryEnum.BINARY);
registerJdbcType(Types.BOOLEAN, BOOLEAN, JdbcTypeCategoryEnum.NUMERIC);
registerJdbcType(Types.CHAR, CHAR, JdbcTypeCategoryEnum.TEXTUAL);
registerJdbcType(Types.NCHAR, NCHAR, JdbcTypeCategoryEnum.TEXTUAL);
registerJdbcType(Types.CLOB, CLOB, JdbcTypeCategoryEnum.TEXTUAL);
registerJdbcType(Types.DATALINK, DATALINK, JdbcTypeCategoryEnum.SPECIAL);
registerJdbcType(Types.DATE, DATE, JdbcTypeCategoryEnum.DATETIME);
Expand All @@ -133,6 +147,13 @@ public abstract class TypeMap
registerJdbcType(Types.TINYINT, TINYINT, JdbcTypeCategoryEnum.NUMERIC);
registerJdbcType(Types.VARBINARY, VARBINARY, JdbcTypeCategoryEnum.BINARY);
registerJdbcType(Types.VARCHAR, VARCHAR, JdbcTypeCategoryEnum.TEXTUAL);
registerJdbcType(Types.NVARCHAR, NVARCHAR, JdbcTypeCategoryEnum.TEXTUAL);
registerJdbcType(Types.NCHAR, NCHAR, JdbcTypeCategoryEnum.TEXTUAL);
registerJdbcType(Types.LONGNVARCHAR, LONGNVARCHAR, JdbcTypeCategoryEnum.TEXTUAL);
registerJdbcType(Types.NCLOB, NCLOB, JdbcTypeCategoryEnum.TEXTUAL);
registerJdbcType(Types.ROWID, ROWID, JdbcTypeCategoryEnum.TEXTUAL);
registerJdbcType(Types.SQLXML, SQLXML, JdbcTypeCategoryEnum.TEXTUAL);


// Torque/Turbine extensions which we only support when reading from an XML schema
_typeNameToTypeCode.put("BOOLEANINT", new Integer(Types.TINYINT));
Expand Down
23 changes: 16 additions & 7 deletions src/main/java/org/apache/ddlutils/platform/JdbcModelReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.ddlutils.DatabaseOperationException;
import org.apache.ddlutils.Platform;
import org.apache.ddlutils.PlatformInfo;
import org.apache.ddlutils.model.CascadeActionEnum;
Expand Down Expand Up @@ -544,13 +545,21 @@ protected Collection readTables(String catalog, String schemaPattern, String[] t

while (tableData.next())
{
Map values = readColumns(tableData, getColumnsForTable());
Table table = readTable(metaData, values);

if (table != null)
{
tables.add(table);
}
try
{
Map values = readColumns(tableData, getColumnsForTable());
Table table = readTable(metaData, values);

if (table != null)
{
tables.add(table);
}
}
catch(SQLException exception)
{
exception.printStackTrace();
//continue
}
}

final Collator collator = Collator.getInstance();
Expand Down