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

已查看 314 次
跳至第一个未读帖子

Alexander Reichman

未读,
2021年12月28日 05:29:592021/12/28
收件人 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

未读,
2021年12月28日 05:49:192021/12/28
收件人 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.
回复全部
回复作者
转发
0 个新帖子