[英]insert query using Jooq is it possible?
I have insert statement in a string value now i want to change that into Jooq and excute the jooq on the DB is it possible ? 我现在在字符串值中插入语句我想将其更改为Jooq并在DB上执行jooq是否可能? or am i over expecting ?
还是我过度期待?
My Insert Query : 我的插入查询:
INSERT INTO ANTIQUES (ID,TYPE,NAME,PRICE) VALUES (21, 01, 'Ottoman', 200.00);
Here are some details missing in the above answer, and also on JOOQ's website. 以下是上述答案中缺少的一些细节,以及JOOQ网站上的一些细节。
create.insertInto(Antiques.ANTIQUES, Antiques.ANTIQUES.ID, Antiques.ANTIQUES.TYPE, Antiques.ANTIQUES.NAME,Antiques.ANTIQUES.PRICE) .values(21, 01, 'Ottoman', 200.00).execute();
Antiques.ANTIQUES
, "Antiques" is the name of the class in tables package and ANTIQUES is the static final object created in the same class for reference. Antiques.ANTIQUES
,“Antiques”是表包中类的名称,ANTIQUES是在同一类中创建的静态最终对象以供参考。 Antiques.ANTIQUES.TYPE
. Antiques.ANTIQUES.TYPE
参考。 Yes, you can do this. 是的,你可以这样做。 It should be similiar with the following code.
它应该类似于以下代码。
create.insertInto(ANTIQUES,
ANTIQUES.ID, ANTIQUES.TYPE, ANTIQUES.NAME, ANTIQUES.PRICE)
.values(21, 01, 'Ottoman', 200.00);
Please check the tutorial and document. 请查看教程和文档。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.