(self)
| 36 | self.__sqlite = sqlite3 |
| 37 | |
| 38 | def connect(self): |
| 39 | self.initConnection() |
| 40 | self.checkFileDb() |
| 41 | |
| 42 | try: |
| 43 | self.connector = self.__sqlite.connect(database=self.db, check_same_thread=False, timeout=conf.timeout) |
| 44 | |
| 45 | cursor = self.connector.cursor() |
| 46 | cursor.execute("SELECT * FROM sqlite_master") |
| 47 | cursor.close() |
| 48 | |
| 49 | except (self.__sqlite.DatabaseError, self.__sqlite.OperationalError): |
| 50 | warnMsg = "unable to connect using SQLite 3 library, trying with SQLite 2" |
| 51 | logger.warning(warnMsg) |
| 52 | |
| 53 | try: |
| 54 | try: |
| 55 | import sqlite |
| 56 | except ImportError: |
| 57 | errMsg = "sqlmap requires 'python-sqlite' third-party library " |
| 58 | errMsg += "in order to directly connect to the database '%s'" % self.db |
| 59 | raise SqlmapMissingDependence(errMsg) |
| 60 | |
| 61 | self.__sqlite = sqlite |
| 62 | self.connector = self.__sqlite.connect(database=self.db, check_same_thread=False, timeout=conf.timeout) |
| 63 | except (self.__sqlite.DatabaseError, self.__sqlite.OperationalError) as ex: |
| 64 | raise SqlmapConnectionException(getSafeExString(ex)) |
| 65 | |
| 66 | self.initCursor() |
| 67 | self.printConnected() |
| 68 | |
| 69 | def fetchall(self): |
| 70 | try: |
nothing calls this directly
no test coverage detected