expect user name to be null (SPR-7228)

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3363 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
Juergen Hoeller
2010-05-21 15:59:00 +00:00
parent b261d6e634
commit db32d52375
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2007 the original author or authors.
* Copyright 2002-2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,6 +24,7 @@ import java.sql.SQLException;
* This class is intended for internal use by the Simple JDBC classes.
*
* @author Thomas Risberg
* @author Juergen Hoeller
* @since 2.5
*/
public class DerbyCallMetaDataProvider extends GenericCallMetaDataProvider {
@@ -32,11 +33,14 @@ public class DerbyCallMetaDataProvider extends GenericCallMetaDataProvider {
super(databaseMetaData);
}
@Override
public String metaDataSchemaNameToUse(String schemaName) {
// Use current user schema if no schema specified
return schemaName == null ? getUserName().toUpperCase() : super.metaDataSchemaNameToUse(schemaName);
if (schemaName != null) {
return super.metaDataSchemaNameToUse(schemaName);
}
// Use current user schema if no schema specified...
String userName = getUserName();
return (userName != null ? userName.toUpperCase() : null);
}
}