HHH-6169 - Only call getVersion methods if debugs is enabled

This commit is contained in:
JustinKSU 2011-04-28 19:09:12 -05:00 committed by Hardy Ferentschik
parent f0c2488d91
commit 64fe46444b
1 changed files with 15 additions and 13 deletions

View File

@ -113,19 +113,21 @@ public class JdbcServicesImpl implements JdbcServices, ServiceRegistryAwareServi
Connection connection = jdbcConnectionAccess.obtainConnection(); Connection connection = jdbcConnectionAccess.obtainConnection();
try { try {
DatabaseMetaData meta = connection.getMetaData(); DatabaseMetaData meta = connection.getMetaData();
LOG.debugf( "Database ->\n" + " name : %s\n" + " version : %s\n" + " major : %s\n" + " minor : %s", if(LOG.isDebugEnabled()) {
meta.getDatabaseProductName(), LOG.debugf( "Database ->\n" + " name : %s\n" + " version : %s\n" + " major : %s\n" + " minor : %s",
meta.getDatabaseProductVersion(), meta.getDatabaseProductName(),
meta.getDatabaseMajorVersion(), meta.getDatabaseProductVersion(),
meta.getDatabaseMinorVersion() meta.getDatabaseMajorVersion(),
); meta.getDatabaseMinorVersion()
LOG.debugf( "Driver ->\n" + " name : %s\n" + " version : %s\n" + " major : %s\n" + " minor : %s", );
meta.getDriverName(), LOG.debugf( "Driver ->\n" + " name : %s\n" + " version : %s\n" + " major : %s\n" + " minor : %s",
meta.getDriverVersion(), meta.getDriverName(),
meta.getDriverMajorVersion(), meta.getDriverVersion(),
meta.getDriverMinorVersion() meta.getDriverMajorVersion(),
); meta.getDriverMinorVersion()
LOG.debugf( "JDBC version : %s.%s", meta.getJDBCMajorVersion(), meta.getJDBCMinorVersion() ); );
LOG.debugf( "JDBC version : %s.%s", meta.getJDBCMajorVersion(), meta.getJDBCMinorVersion() );
}
metaSupportsScrollable = meta.supportsResultSetType( ResultSet.TYPE_SCROLL_INSENSITIVE ); metaSupportsScrollable = meta.supportsResultSetType( ResultSet.TYPE_SCROLL_INSENSITIVE );
metaSupportsBatchUpdates = meta.supportsBatchUpdates(); metaSupportsBatchUpdates = meta.supportsBatchUpdates();