Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
cvillarongace committed Jul 15, 2019
1 parent 54e07ca commit 2858abb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions activejdbc/src/main/java/org/javalite/activejdbc/Registry.java
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,14 @@ private Map<String, ColumnMetadata> fetchMetaParams(DatabaseMetaData databaseMet
*/
String[] names = table.split("\\.", 3);

String schema = databaseMetaData.getConnection().getSchema();
String schema = null; //

try {
if(databaseMetaData.getClass().getMethod("getSchema")!=null){
schema = databaseMetaData.getConnection().getSchema();
}
} catch (NoSuchMethodException e) {}

String tableName;

switch (names.length) {
Expand All @@ -207,8 +214,12 @@ private Map<String, ColumnMetadata> fetchMetaParams(DatabaseMetaData databaseMet
default:
throw new DBException("invalid table name: " + table);
}

String catalog = databaseMetaData.getConnection().getCatalog();
String catalog = null;
try {
if(databaseMetaData.getClass().getMethod("getCatalog")!=null){
catalog = databaseMetaData.getConnection().getCatalog();
}
} catch (NoSuchMethodException e) {}

if(dbType.equalsIgnoreCase("h2")){
// keep quoted table names as is, otherwise use uppercase
Expand Down
Binary file added classes/artifacts/activejdbc_jar/activejdbc.zip
Binary file not shown.

0 comments on commit 2858abb

Please sign in to comment.