Skip to content

Commit

Permalink
fix case problem with dialects
Browse files Browse the repository at this point in the history
  • Loading branch information
erilong committed Nov 20, 2007
1 parent 3be7e22 commit 30526b7
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 1 deletion.
Expand Up @@ -177,7 +177,7 @@ private String checkSchema(String schema) {
return (schema == null || schema.trim().length() == 0) ? null : schema;
}

public Table findTable(String _schema, final String tableName) throws Exception {
public Table findTable(String _schema, final String _tableName) throws Exception {
final String schema = checkSchema(_schema);
return (Table) jdbcTemplate.execute(new ConnectionCallback() {
public Object doInConnection(Connection c) throws SQLException, DataAccessException {
Expand All @@ -187,6 +187,10 @@ public Object doInConnection(Connection c) throws SQLException, DataAccessExcept
metaData.setCatalog(schema);
metaData.setSchemaPattern(schema);
metaData.setTableTypes(null);
String tableName = _tableName;
if (!supportsMixedCaseNamesInCatalog()) {
tableName = _tableName.toUpperCase();
}
ResultSet tableData = metaData.getTables(tableName);
while (tableData != null && tableData.next()) {
Map<String, Object> values = readColumns(tableData, initColumnsForTable());
Expand Down
Expand Up @@ -67,6 +67,8 @@ public void initTrigger(DataEventType dml, Trigger config,

public boolean isEmptyStringNulled();

public boolean supportsMixedCaseNamesInCatalog();

public void purge();

public SQLErrorCodeSQLExceptionTranslator getSqlErrorTranslator();
Expand Down
Expand Up @@ -127,6 +127,10 @@ public boolean isEmptyStringNulled() {
return false;
}

public boolean supportsMixedCaseNamesInCatalog() {
return true;
}

public void purge() {
}

Expand Down
Expand Up @@ -111,6 +111,10 @@ protected boolean doesTriggerExistOnPlatform(String schema, String tableName,
new Object[] { triggerName, tableName }) > 0;
}

public boolean supportsMixedCaseNamesInCatalog() {
return false;
}

public void purge() {
jdbcTemplate.update("purge recyclebin");

Expand Down
Expand Up @@ -115,6 +115,10 @@ public boolean isEmptyStringNulled() {
return false;
}

public boolean supportsMixedCaseNamesInCatalog() {
return true;
}

public void purge() {
}

Expand Down

0 comments on commit 30526b7

Please sign in to comment.