Tag: cws_src680_dba24d
User: fs      
Date: 2007-11-19 09:49:52+0000
Modified:
   dba/dbaccess/source/ui/uno/copytablewizard.cxx

Log:
 #i81658# re-use the prepared statement already created by the CopyTableSource 
implementation, instead of creating a new one

File Changes:

Directory: /dba/dbaccess/source/ui/uno/
=======================================

File [changed]: copytablewizard.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/uno/copytablewizard.cxx?r1=1.1.2.13&r2=1.1.2.14
Delta lines:  +10 -15
---------------------
--- copytablewizard.cxx 2007-11-19 08:55:13+0000        1.1.2.13
+++ copytablewizard.cxx 2007-11-19 09:49:49+0000        1.1.2.14
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: copytablewizard.cxx,v $
  *
- *  $Revision: 1.1.2.13 $
+ *  $Revision: 1.1.2.14 $
  *
- *  last change: $Author: fs $ $Date: 2007/11/19 08:55:13 $
+ *  last change: $Author: fs $ $Date: 2007/11/19 09:49:49 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -300,7 +300,7 @@
             If the source object refers to a query which contains parameters, 
those parameters
             are filled in, using an interaction handler.
         */
-        Reference< XPreparedStatement >
+        ::utl::SharedUNOComponent< XPreparedStatement >
                 impl_createSourceStatement_throw() const;
 
         /** copies the data rows from the given source result set to the given 
destination table
@@ -900,26 +900,23 @@
     }
 
     //-------------------------------------------------------------------------
-    Reference< XPreparedStatement > 
CopyTableWizard::impl_createSourceStatement_throw() const
+    ::utl::SharedUNOComponent< XPreparedStatement > 
CopyTableWizard::impl_createSourceStatement_throw() const
     {
         OSL_PRECOND( m_xSourceConnection.is(), 
"CopyTableWizard::impl_createSourceStatement_throw: illegal call!" );
         if ( !m_xSourceConnection.is() )
             throw RuntimeException( ::rtl::OUString(), *const_cast< 
CopyTableWizard* >( this ) );
 
-        Reference< XPreparedStatement > xStatement;
+        ::utl::SharedUNOComponent< XPreparedStatement > xStatement;
         switch ( m_nCommandType )
         {
         case CommandType::TABLE:
-        {
-            ::rtl::OUString sSQL( m_pSourceObject->getSelectStatement() );
-            xStatement.set( m_xSourceConnection->prepareStatement( sSQL ), 
UNO_SET_THROW );
-        }
+            xStatement.set( m_pSourceObject->getPreparedSelectStatement(), 
UNO_SET_THROW );
         break;
 
         case CommandType::QUERY:
         {
             ::rtl::OUString sQueryCommand( 
m_pSourceObject->getSelectStatement() );
-            xStatement.set( m_xSourceConnection->prepareStatement( 
sQueryCommand ), UNO_SET_THROW );
+            xStatement.set( m_pSourceObject->getPreparedSelectStatement(), 
UNO_SET_THROW );
 
             // check whether we have to fill in parameter values
             // create and fill a composer
@@ -928,7 +925,7 @@
             ::utl::SharedUNOComponent< XSingleSelectQueryComposer > xComposer;
             if ( xFactory.is() )
                 // note: connections below the sdb-level are allowed to not 
support the XMultiServiceFactory interface
-                xComposer.set( xFactory->createInstance( 
SERVICE_NAME_SINGLESELECTQUERYCOMPOSER ), UNO_QUERY_THROW );
+                xComposer.set( xFactory->createInstance( 
SERVICE_NAME_SINGLESELECTQUERYCOMPOSER ), UNO_QUERY );
 
             if ( xComposer.is() )
             {
@@ -1332,9 +1329,7 @@
                         }
                     }
 
-                    ::utl::SharedUNOComponent< XPreparedStatement > xStatement;
-                    xStatement.set( impl_createSourceStatement_throw(), 
UNO_SET_THROW );
-
+                    ::utl::SharedUNOComponent< XPreparedStatement > 
xStatement( impl_createSourceStatement_throw(), UNO_SET_THROW );
                     Reference< XResultSet > xSourceResultSet( 
xStatement->executeQuery() );
                     impl_copyRows_throw( xSourceResultSet, xTable );
                 }




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to