New versions: Dev (3.15) | Latest (3.14) | 3.13 | 3.12 | 3.11 | 3.10 | 3.9 | 3.8 | Old versions: 3.7 | 3.6 | 3.5 | 3.4 | 3.3 | 2.6

Step 5: Querying

Applies to ✅ Open Source Edition   ✅ Express Edition   ✅ Professional Edition   ✅ Enterprise Edition

Let's add a simple query:

Factory create = new Factory(conn, SQLDialect.MYSQL);
Result<Record> result = create.select().from(POSTS).fetch();

First get an instance of Factory so we can write a simple SELECT query. We pass an instance of the MySQL connection to Factory. Note that the factory doesn't close the connection. We'll have to do that ourselves.

We then use jOOQ's DSL to return an instance of Result. We'll be using this result in the next step.

Feedback

Do you have any feedback about this page? We'd love to hear it!

The jOOQ Logo