java.lang.IllegalArgumentException: Field is not contained in Row (1)

302 views
Skip to first unread message

Alexander Reichman

unread,
Dec 28, 2021, 5:29:59 AM12/28/21
to jOOQ User Group

Hello,

I am trying to evaluate JOOQ and I created the simple project in Eclipse based on the example provided here

Using Java Object Oriented Querying (jOOQ) with PostgreSQL - 2ndQuadrant | PostgreSQL

I have successfully generated the classes when I am running the simple java program to retrieve  the data from database I am getting the following error here ( Main.java screen shot is attached)


Integer rank = r.getValue(LARGECITIES.RANK);
….

java.lang.IllegalArgumentException: Field (“jooq”.”largecities”.”rank”) is not contained in Row (1)
at org.jooq.impl.Tools.indexFail(Tools.java:1769)
at org.jooq.impl.AbstractRecord.get(AbstractRecord.java:331)
at org.jooq.impl.AbstractRecord.getValue(AbstractRecord.java:1250)
at org.jooq.jOOQTestpackage.Main.main(Main.java:23)

However I have created the table largecities in the Public schema. “TEST” is the name of my database in Postgres.

Any help will be appreciated

Thanks
Alex

Eclipse Project.JPG
Main.java.jpg

Lukas Eder

unread,
Dec 28, 2021, 5:49:19 AM12/28/21
to jOOQ User Group
Thanks for your message.

For the record, you also cross posted this here:

For the benefit of other readers, can you please complete that stack overflow question with the full details.

The answer is simple. Your query doesn't do anything. It does not list any columns in SELECT, nor does it list any tables in FROM. You cannot read a specific column from your result, which you didn't include in the query.

I hope this helps,
Lukas

--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jooq-user/0f2f78cc-1e15-4c22-8690-ff41ffca8497n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages