Tag: cws_src680_dba24d
User: oj      
Date: 2007-11-06 10:58:52+0000
Modified:
   dba/connectivity/source/drivers/jdbc/JConnection.cxx
   dba/connectivity/source/drivers/odbc/OPreparedStatement.cxx

Log:
 RESYNC: (1.6-1.7); FILE MERGED

File Changes:

Directory: /dba/connectivity/source/drivers/jdbc/
=================================================

File [changed]: JConnection.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/jdbc/JConnection.cxx?r1=1.6.18.1&r2=1.6.18.2
Delta lines:  +4 -3
-------------------
--- JConnection.cxx     2007-11-06 09:04:43+0000        1.6.18.1
+++ JConnection.cxx     2007-11-06 10:58:37+0000        1.6.18.2
@@ -833,6 +833,7 @@
             if ( !_sDriverClass.getLength() )
             {
                 m_aLogger.log( LogLevel::SEVERE, STR_LOG_NO_DRIVER_CLASS );
+                throw SQLException(::rtl::OUString::createFromAscii("The 
specified driver was empty!"),*this,::rtl::OUString(),1000,Any());
             }
             else
             {

Directory: /dba/connectivity/source/drivers/odbc/
=================================================

File [changed]: OPreparedStatement.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/odbc/OPreparedStatement.cxx?r1=1.44.18.1&r2=1.44.18.2
Delta lines:  +9 -8
-------------------
--- OPreparedStatement.cxx      2007-11-06 09:07:49+0000        1.44.18.1
+++ OPreparedStatement.cxx      2007-11-06 10:58:40+0000        1.44.18.2
@@ -104,9 +104,9 @@
 OPreparedStatement::OPreparedStatement( OConnection* _pConnection,const 
TTypeInfoVector& _TypeInfo,const ::rtl::OUString& sql)
        :OStatement_BASE2(_pConnection)
        ,m_aTypeInfo(_TypeInfo)
+    ,numParams(0)
        ,boundParams(NULL)
        ,m_bPrepared(sal_False)
-
 {
        m_sSqlStatement = sql;
        try
@@ -665,7 +665,7 @@
        OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
        // Get the number of parameters
        numParams = 0;
-       N3SQLNumParams (m_aStatementHandle,(short*)&numParams);
+       N3SQLNumParams (m_aStatementHandle,&numParams);
 
        // There are parameter markers, allocate the bound
        // parameter objects
@@ -700,7 +700,7 @@
        // Sanity check the parameter number
 
        if ((index >= 1) &&
-               (index <= numParams))
+               (index <= numParams) && bufLen > 0 )
        {
                b = boundParams[index - 1].allocBindDataBuffer(bufLen);
        }
@@ -983,6 +983,7 @@
 
 void OPreparedStatement::FreeParams()
 {
+    numParams = 0;
        delete [] boundParams;
        boundParams = NULL;
 }
@@ -1023,11 +1024,11 @@
 {
        if(!isPrepared())
        {
-               m_bPrepared = sal_True;
                OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
                ::rtl::OString 
aSql(::rtl::OUStringToOString(m_sSqlStatement,getOwnConnection()->getTextEncoding()));
                SQLRETURN nReturn = 
N3SQLPrepare(m_aStatementHandle,(SDB_ODBC_CHAR *) 
aSql.getStr(),aSql.getLength());
                
OTools::ThrowException(m_pConnection,nReturn,m_aStatementHandle,SQL_HANDLE_STMT,*this);
+        m_bPrepared = sal_True;
                initBoundParam();
        }
 }




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

Reply via email to