Connection connection = getConnection();
Field<String> field = DSL.field( "COFFEE_DESCRIPTION", SQLDataType.VARCHAR );
List<SelectField<?>> fields = Collections.<SelectField<?>>singletonList( field );
Table<Record> table = DSL.table( "coffee_beverages" );
DSLContext dslContext = DSL.using( connection, SQLDialect.POSTGRES );
Result<Record> coffee_beverages = dslContext.select( fields ).from( table ).fetch();
Exception in thread "main" org.jooq.exception.DataAccessException: SQL [select COFFEE_DESCRIPTION from coffee_beverages]; ERROR: column "coffee_description" does not exist
Position: 8
at org.jooq.impl.Utils.translate(Utils.java:1645)
at org.jooq.impl.DefaultExecuteContext.sqlException(DefaultExecuteContext.java:661)
at org.jooq.impl.AbstractQuery.execute(AbstractQuery.java:356)
at org.jooq.impl.AbstractResultQuery.fetch(AbstractResultQuery.java:290)
at org.jooq.impl.SelectImpl.fetch(SelectImpl.java:2316)
at Main.main(Main.java:28)
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:497)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
Caused by: org.postgresql.util.PSQLException: ERROR: column "coffee_description" does not exist
Position: 8
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2182)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1911)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:173)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:645)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:495)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:488)
at org.jooq.tools.jdbc.DefaultPreparedStatement.execute(DefaultPreparedStatement.java:194)
at org.jooq.impl.AbstractResultQuery.execute(AbstractResultQuery.java:247)
at org.jooq.impl.AbstractQuery.execute(AbstractQuery.java:342)
... 8 more
Hope all this helps you to reproduce and fix the problem. Anyway I'm ready to provide you any further information you would need.
--
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.
For more options, visit https://groups.google.com/d/optout.
|
|
Thanks for the hint!
We use org.jooq:jooq:3.6.2-private from Maven and it seems to have no javadoc attached since my IntelliJ Idea failed to download them. Or maybe I'm missing something.
By the way your javadoc at http://www.jooq.org/javadoc/3.6.2/ seems to point to wrong method, since they even have different return values.
static <T> Field<T>
fieldByName(DataType<T> type, String... qualifiedName)Deprecated.
- [#3843] - 3.6.0 - usesequence(Name, DataType)instead$
Wish you every success!