summaryrefslogtreecommitdiff
path: root/connectivity/source/drivers/firebird
diff options
context:
space:
mode:
authorAndres Gomez <agomez@igalia.com>2013-06-05 18:16:49 +0300
committerAndrzej J.R. Hunt <andrzej@ahunt.org>2013-07-12 16:34:24 +0100
commite05dbdffcf79a4216ac2b07beb1ef5bb8d62c8d7 (patch)
tree35a35f573c756510c00fe48e7874236b0b7d2c5e /connectivity/source/drivers/firebird
parent77c2b8ddd20235b1a3f7cf7ac9cf2d0575fa563e (diff)
fb-sdbc: Pretty printing table log output
Diffstat (limited to 'connectivity/source/drivers/firebird')
-rw-r--r--connectivity/source/drivers/firebird/FConnection.cxx9
-rw-r--r--connectivity/source/drivers/firebird/FDatabaseMetaData.cxx34
2 files changed, 32 insertions, 11 deletions
diff --git a/connectivity/source/drivers/firebird/FConnection.cxx b/connectivity/source/drivers/firebird/FConnection.cxx
index 0cd41591ca14..0f9b20b1325e 100644
--- a/connectivity/source/drivers/firebird/FConnection.cxx
+++ b/connectivity/source/drivers/firebird/FConnection.cxx
@@ -62,12 +62,16 @@ OConnection::OConnection(FirebirdDriver* _pDriver)
m_bUseCatalog(sal_False),
m_bUseOldDateFormat(sal_False)
{
+ SAL_INFO("connectivity.firebird", "=> OConnection::OConnection().");
+
m_pDriver->acquire();
m_DBHandler = NULL;
}
//-----------------------------------------------------------------------------
OConnection::~OConnection()
{
+ SAL_INFO("connectivity.firebird", "=> OConnection::~OConnection().");
+
if(!isClosed())
close();
m_pDriver->release();
@@ -101,7 +105,7 @@ static int pr_error (long* status, char* operation)
void OConnection::construct(const ::rtl::OUString& url,const Sequence< PropertyValue >& info) throw(SQLException)
{
- SAL_INFO("connectivity.firebird", "=> OConnection::construct()." );
+ SAL_INFO("connectivity.firebird", "=> OConnection::construct().");
osl_atomic_increment( &m_refCount );
@@ -169,6 +173,9 @@ Reference< XPreparedStatement > SAL_CALL OConnection::prepareStatement( const ::
// --------------------------------------------------------------------------------
Reference< XPreparedStatement > SAL_CALL OConnection::prepareCall( const ::rtl::OUString& _sSql ) throw(SQLException, RuntimeException)
{
+ SAL_INFO("connectivity.firebird", "=> OConnection::prepareCall(). "
+ "_sSql: " << _sSql);
+
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OConnection_BASE::rBHelper.bDisposed);
diff --git a/connectivity/source/drivers/firebird/FDatabaseMetaData.cxx b/connectivity/source/drivers/firebird/FDatabaseMetaData.cxx
index 2044cbac1d41..dfafff59237c 100644
--- a/connectivity/source/drivers/firebird/FDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/firebird/FDatabaseMetaData.cxx
@@ -896,7 +896,7 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables(
Reference< XResultSet > rs = statement->executeQuery(query.getStr());
Reference< XRow > xRow( rs, UNO_QUERY_THROW );
ODatabaseMetaDataResultSet::ORows aRows;
- int rows = 0;
+ sal_Int32 rows = 0;
while( rs->next() )
{
ODatabaseMetaDataResultSet::ORow aRow(3);
@@ -908,15 +908,29 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables(
OUString desc = xRow->getString( 5 );
rows++;
- if (rows < 10)
- printf("DEBUG !!! row %i : ", rows);
- else
- printf("DEBUG !!! row %i: ", rows);
- printf("%s | ", OUStringToOString( schema, RTL_TEXTENCODING_UTF8 ).getStr());
- printf("%s | ", OUStringToOString( aTableName, RTL_TEXTENCODING_UTF8 ).getStr());
- printf("%i | ", systemFlag);
- printf("%i | ", systemFlag);
- printf("%s | \n", OUStringToOString( desc, RTL_TEXTENCODING_UTF8 ).getStr());
+ if (rows < 10)
+ {
+ if ( 1 == rows )
+ SAL_DEBUG("COLUMNS | "
+ "schema | "
+ "TABLENAME | "
+ "SF| "
+ "TT| "
+ "desc |");
+ SAL_DEBUG("Row " << OUString::number(0).concat(OUString::number(rows)) << ": | "
+ << schema << " | "
+ << aTableName << " | "
+ << systemFlag << " | "
+ << tableType << " | "
+ << desc << " |");
+ }
+ else
+ SAL_DEBUG("Row " << rows << ": | "
+ << schema << " | "
+ << aTableName << " | "
+ << systemFlag << " | "
+ << tableType << " | "
+ << desc << " |");
OUString aTableType;
if( 1 == systemFlag )