Tag: cws_src680_sqlite
User: aklitzing
Date: 2006/08/18 11:53:08

Modified:
   dba/connectivity/source/drivers/sqlite3/sqDB.cpp
   dba/connectivity/source/drivers/sqlite3/sqDB.h

Log:
 * sqQueryPreparedCursor added

File Changes:

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

File [changed]: sqDB.cpp
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/sqlite3/sqDB.cpp?r1=1.1.2.1&r2=1.1.2.2
Delta lines:  +18 -8
--------------------
--- sqDB.cpp    16 Aug 2006 14:57:09 -0000      1.1.2.1
+++ sqDB.cpp    18 Aug 2006 18:53:05 -0000      1.1.2.2
@@ -4,9 +4,9 @@
  *

  *  $RCSfile: sqDB.cpp,v $

  *

- *  $Revision: 1.1.2.1 $

+ *  $Revision: 1.1.2.2 $

  *

- *  last change: $Author: aklitzing $ $Date: 2006/08/16 14:57:09 $

+ *  last change: $Author: aklitzing $ $Date: 2006/08/18 18:53:05 $

  *

  *  Original contributor: André Klitzing

  *

@@ -147,13 +147,13 @@
 

 }

 

-sqQueryPrepared* sqDB::getQuery(const char* statement)

+sqQueryPreparedCursor* sqDB::getQueryCursor(const char* statement)

 {

        sqlite3_stmt* stmt;

        const char* unused_stmt = 0;

 

        int resultCode = sqlite3_prepare(m_db, statement, -1, &stmt, 
&unused_stmt);

-       sqQueryPrepared* ret = new sqQueryPrepared(resultCode, unused_stmt, 
stmt, this);

+       sqQueryPreparedCursor* ret = new sqQueryPreparedCursor(resultCode, 
unused_stmt, stmt, this);

 

        setTransactionError(resultCode);

        m_list.add(ret);

@@ -161,6 +161,11 @@
        return ret;

 }

 

+sqQueryPrepared* sqDB::getQuery(const char* statement)

+{

+       return getQueryCursor(statement); // implicit-cast - 
sqQueryPreparedCursor has only some new functions at the moment!

+}

+

 

 

 sqQueryTable* sqDB::getQueryTable(const char* prepared_stmt, const char* part)

@@ -171,13 +176,18 @@
        return ret;

 }

 

-// sqlite3_bind will come later

-sqQueryPrepared* sqDB::getQuery(const char* prepared_stmt, const char* part)

+sqQueryPreparedCursor* sqDB::getQueryCursor(const char* prepared_stmt, const 
char* part)

 {

        char* stmt = sqlite3_mprintf(prepared_stmt, part);

-       sqQueryPrepared* ret = getQuery(stmt);

+       sqQueryPreparedCursor* ret = getQueryCursor(stmt);

        sqlite3_free(stmt);

        return ret;

+}

+

+

+sqQueryPrepared* sqDB::getQuery(const char* prepared_stmt, const char* part)

+{

+       return getQueryCursor(prepared_stmt, part);  // implicit-cast - 
sqQueryPreparedCursor has only some new functions at the moment!

 }

 

 


File [changed]: sqDB.h
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/sqlite3/sqDB.h?r1=1.1.2.1&r2=1.1.2.2
Delta lines:  +19 -4
--------------------
--- sqDB.h      16 Aug 2006 14:57:10 -0000      1.1.2.1
+++ sqDB.h      18 Aug 2006 18:53:05 -0000      1.1.2.2
@@ -4,9 +4,9 @@
  *

  *  $RCSfile: sqDB.h,v $

  *

- *  $Revision: 1.1.2.1 $

+ *  $Revision: 1.1.2.2 $

  *

- *  last change: $Author: aklitzing $ $Date: 2006/08/16 14:57:10 $

+ *  last change: $Author: aklitzing $ $Date: 2006/08/18 18:53:05 $

  *

  *  Original contributor: André Klitzing

  *

@@ -39,8 +39,9 @@
 #define __SQLITE3s_SQDB_H

 

 #include <sqlite3.h>

-#include "sqQueryPrepared.h"

+#include "sqQueryPreparedCursor.h"

 #include "sqQueryTable.h"

+// #include "sqQueryPrepared.h" // you don't need it - sqQueryPreparedCursor 
has it

 

 //! An 'Interface object' to a sqlite3 database file

 /*!

@@ -192,18 +193,32 @@
        //! \return a pointer to a sqQueryTable object

        sqQueryTable* getQueryTable(const char* statement);

 

+       //! \fn sqQueryPreparedCursor* getQueryCursor(const char* statement)

+       //! \brief it will send a statement with result table to database

+       //! \param statement a SQL-Statement (e. g. SELECT)

+       //! \return a pointer to a sqQueryPreparedCursor object

+       sqQueryPreparedCursor* getQueryCursor(const char* statement);

+

        //! \fn sqQueryPrepared* getQuery(const char* statement)

        //! \brief it will send a statement with result table to database

        //! \param statement a SQL-Statement (e. g. SELECT)

        //! \return a pointer to a sqQueryPrepared object

        sqQueryPrepared* getQuery(const char* statement);

 

+

        //! \fn sqQueryTable* getQueryTable(const char* prepared_stmt, const 
char* part)

        //! \brief it will send a statement with result table to database. 
"part" will be inserted into "prepared_stmt" like sprintf()

        //! \param prepared_stmt a SQL-Statement with a %q as a placeholder for 
part (e. g. SELECT column FROM table WHERE id = '%q')

        //! \param part it will be inserted into prepared_stmt

        //! \return a pointer to a sqQueryTable object

        sqQueryTable* getQueryTable(const char* prepared_stmt, const char* 
part);

+

+       //! \fn sqQueryPreparedCursor* getQueryCursor(const char* 
prepared_stmt, const char* part)

+       //! \brief it will send a statement with result table to database. 
"part" will be inserted into "prepared_stmt" like sprintf()

+       //! \param prepared_stmt a SQL-Statement with a %q as a placeholder for 
part (e. g. SELECT column FROM table WHERE id = '%q')

+       //! \param part it will be inserted into prepared_stmt

+       //! \return a pointer to a sqQueryPreparedCursor object

+       sqQueryPreparedCursor* getQueryCursor(const char* prepared_stmt, const 
char* part);

 

        //! \fn sqQueryPrepared* getQuery(const char* prepared_stmt, const 
char* part)

        //! \brief it will send a statement with result table to database. 
"part" will be inserted into "prepared_stmt" like sprintf()





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

Reply via email to