Beispiel #1
0
        public IDBResult executeSQL(String strStatement, Object[] values, boolean bReportNonUnique, boolean bNoCopy)
        {
            if (m_db == null)
            {
                throw new Exception("executeSQL: m_db == null");
            }

            lock (m_db)
            {
                var           stmt = Prepare(strStatement, values);
                CSqliteResult res  = new CSqliteResult(stmt, bNoCopy);
                int           rc   = res.executeStatement();
                if (rc != Sqlite3.SQLITE_ROW)
                {
                    if (bReportNonUnique && rc == Sqlite3.SQLITE_CONSTRAINT)
                    {
                        res.close();
                        return(new CSqliteResult(true));
                    }

                    res.checkError();
                    res.close();
                }
                return(res);
            }
        }
Beispiel #2
0
        public IDBResult executeSQL(String strStatement, Object[] values, boolean bReportNonUnique, boolean bNoCopy)
        {
            if (m_db == null)
                throw new Exception("executeSQL: m_db == null");

            var stmt = Prepare(strStatement, values);
            CSqliteResult res = new CSqliteResult(stmt, bNoCopy);
            int rc = res.executeStatement();
            if (rc != Sqlite3.SQLITE_ROW)
            {
                if (bReportNonUnique && rc == Sqlite3.SQLITE_CONSTRAINT)
                {
                    res.close();
                    return new CSqliteResult(true); 
                }

                res.checkError();
                res.close();
            }

            return res;
        }