# Jython Script to read Internal Database using javadocs

**URL:** <https://forum.inductiveautomation.com/t/jython-script-to-read-internal-database-using-javadocs/86777>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [March 4, 2024, 4:51pm UTC](https://forum.inductiveautomation.com/t/jython-script-to-read-internal-database-using-javadocs/86777 "2024-03-04T16:51:27Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![CJ\_Johnson](https://avatars.discourse-cdn.com/v4/letter/c/b77776/32.png) [@CJ\_Johnson](https://forum.inductiveautomation.com/u/CJ_Johnson)\
**Post date:** [March 4, 2024, 8:18pm UTC](https://forum.inductiveautomation.com/t/jython-script-to-read-internal-database-using-javadocs/86777/9 "2024-03-04T20:18:39Z")

</div>

I've now tried the following

```auto
from com.inductiveautomation.ignition.gateway import SRContext
from simpleorm.dataset import SSessionI

def run():
	query = SRContext.get().getPersistenceInterface().getSession()
	try:
		query.rawQueryMaps("SELECT DEVICESETTINGS.NAME FROM from DEVICESETTINGS", True, [])
	finally:
		    query.close()
	test = []
	for quer in query:
		test.append(quer.getName())
	logger.info("%s" % (test))
	return test

```

Which returns :

```auto
com.inductiveautomation.ignition.common.script.JythonExecException: Traceback (most recent call last): File "", line 9, in File "", line 7, in run at simpleorm.sessionjdbc.SSessionJdbc.rawQueryInner(SSessionJdbc.java:797) at simpleorm.sessionjdbc.SSessionJdbc.rawQueryMaps(SSessionJdbc.java:709) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) simpleorm.utils.SException$Jdbc: simpleorm.utils.SException$Jdbc: org.sqlite.SQLiteException: [SQLITE_ERROR] SQL error or missing database (near "from": syntax error) 

```

---

_[View the full topic](https://forum.inductiveautomation.com/t/jython-script-to-read-internal-database-using-javadocs/86777)._
