請參考
http://www.jooq.org/
Getting started with the tutorial
Your simplest entry point is probably to get the tutorial running. It shows how to use jOOQ and its code generator with a simple MySQL database
- Preparation: Download jOOQ and your SQL driver
- Step 1: Create a SQL database and a table
- Step 2: Generate classes
- Step 3: Write a main class and establish a MySQL connection
- Step 4: Write a query using jOOQ's DSL
- Step 5: Iterate over results
- Step 6: Explore!
注意:
0:請乖乖下載 Jar檔
http://www.jooq.org/download/
http://dev.mysql.com/downloads/connector/j/
1.透過 mysql 示範
CREATE DATABASE `library`; USE `library`; CREATE TABLE `author` ( `id` int NOT NULL, `first_name` varchar(255) DEFAULT NULL, `last_name` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) );
2.沒有乖乖下載1的jar檔,此步驟保證鬼打牆,一定無法產生table 的 java物件
3.連結mysql
4.query語法產生
5.結果foreach
6.還在研究