|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2011 the original author or authors. |
| 2 | + * Copyright 2002-2012 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
@@ -181,8 +181,13 @@ public void initializeWithMetaData(DatabaseMetaData databaseMetaData) throws SQL
|
181 | 181 | setGeneratedKeysColumnNameArraySupported(false);
|
182 | 182 | }
|
183 | 183 | else {
|
184 |
| - logger.debug("GeneratedKeysColumnNameArray is supported for " + databaseProductName); |
185 |
| - setGeneratedKeysColumnNameArraySupported(true); |
| 184 | + if (isGetGeneratedKeysSupported()) { |
| 185 | + logger.debug("GeneratedKeysColumnNameArray is supported for " + databaseProductName); |
| 186 | + setGeneratedKeysColumnNameArraySupported(true); |
| 187 | + } |
| 188 | + else { |
| 189 | + setGeneratedKeysColumnNameArraySupported(false); |
| 190 | + } |
186 | 191 | }
|
187 | 192 | }
|
188 | 193 | catch (SQLException se) {
|
@@ -307,7 +312,7 @@ private void locateTableAndProcessMetaData(DatabaseMetaData databaseMetaData, St
|
307 | 312 | tmd.setTableName(tables.getString("TABLE_NAME"));
|
308 | 313 | tmd.setType(tables.getString("TABLE_TYPE"));
|
309 | 314 | if (tmd.getSchemaName() == null) {
|
310 |
| - tableMeta.put(userName.toUpperCase(), tmd); |
| 315 | + tableMeta.put(userName != null ? userName.toUpperCase() : "", tmd); |
311 | 316 | }
|
312 | 317 | else {
|
313 | 318 | tableMeta.put(tmd.getSchemaName().toUpperCase(), tmd);
|
@@ -335,7 +340,7 @@ private void locateTableAndProcessMetaData(DatabaseMetaData databaseMetaData, St
|
335 | 340 | if (schemaName == null) {
|
336 | 341 | tmd = tableMeta.get(getDefaultSchema());
|
337 | 342 | if (tmd == null) {
|
338 |
| - tmd = tableMeta.get(userName.toUpperCase()); |
| 343 | + tmd = tableMeta.get(userName != null ? userName.toUpperCase() : ""); |
339 | 344 | }
|
340 | 345 | if (tmd == null) {
|
341 | 346 | tmd = tableMeta.get("PUBLIC");
|
|
0 commit comments