# Connecting to adhoc SQLite database from Jython?

**URL:** <https://forum.inductiveautomation.com/t/connecting-to-adhoc-sqlite-database-from-jython/52698>\
**Category:** Ignition\
**Created:** [November 3, 2021, 9:37pm UTC](https://forum.inductiveautomation.com/t/connecting-to-adhoc-sqlite-database-from-jython/52698 "2021-11-03T21:37:01Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [November 4, 2021, 12:06am UTC](https://forum.inductiveautomation.com/t/connecting-to-adhoc-sqlite-database-from-jython/52698/11 "2021-11-04T00:06:43Z")

</div>

```python
session = IgnitionGateway.get().getPersistenceInterface().getSession()

try:
    session.rawQueryMaps("SELECT * FROM SYSPROPS")
finally:
    session.close()

```

You could try this; see [`SSessionJdbc`](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.11/simpleorm/sessionjdbc/SSessionJdbc.html#rawQueryMaps(java.lang.String,boolean,java.lang.Object...)). Make _very sure_ you `close` the session, or this will hose a running gateway until restarted.

---

_[View the full topic](https://forum.inductiveautomation.com/t/connecting-to-adhoc-sqlite-database-from-jython/52698)._
