我想分享我的 sql server 2012 和 2014 工作配置,经过多次尝试后,它们都可以工作。我下载了 jooq3.7.2 企业版使其工作。
这是我的示例配置文件“library.xml”
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<configuration xmlns="http://www.jooq.org/xsd/jooq-codegen-3.7.0.xsd">
<!-- Configure the database connection here -->
<jdbc>
<driver>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver>
<url>jdbc:sqlserver://testdelta1:1433;databaseName=NEO_DB</url>
<user>LOB_ManilaUsers</user>
<password>lobpassword3123</password>
</jdbc>
<generator>
<!-- The default code generator. You can override this one, to generate your own code style.
Supported generators:
- org.jooq.util.JavaGenerator
- org.jooq.util.ScalaGenerator
Defaults to org.jooq.util.JavaGenerator -->
<name>org.jooq.util.JavaGenerator</name>
<database>
<!-- The database type. The format here is:
org.util.[database].[database]Database -->
<!--<name>org.jooq.util.mysql.MySQLDatabase</name> -->
<name>org.jooq.util.sqlserver.SQLServerDatabase</name>
<!-- The database schema (or in the absence of schema support, in your RDBMS this
can be the owner, user, database name) to be generated -->
<!-- specify database name -->
<inputSchema>dbo</inputSchema>
<!-- All elements that are generated from your schema
(A Java regular expression. Use the pipe to separate several expressions)
Watch out for case-sensitivity. Depending on your database, this might be important! -->
<includes>.*</includes>
<!-- All elements that are excluded from your schema
(A Java regular expression. Use the pipe to separate several expressions).
Excludes match before includes -->
<excludes></excludes>
</database>
<target>
<!-- The destination package of your generated classes (within the destination directory) -->
<packageName>com.neoapi.entity</packageName>
<!-- The destination directory of your generated classes -->
<directory>jooq_directory/src_generated</directory>
</target>
</generator>
</configuration>
通常默认模式值为“dbo”。起初,我输入了不起作用的“NEO_DB”。
你可以指定你想要的和
免费版或开源 jooq 3.7.2 不包含数据库名称 SQLServerDatabase。企业版(30天试用)有效。我不确定试用天数是如何开始计算的。
这是我终端的示例日志:
> INFO: Generating table : Tobservationrawdataobservations.java [input=tObservationRawDataObservations, output=tObservationRawDataObservations, pk=PK_ObservationRawDataObservations]
Feb 16, 2016 7:03:35 AM org.jooq.tools.JooqLogger info
INFO: Generating table : UdvPublisheddata.java [input=udv_PublishedData, output=udv_PublishedData, pk=N/A]
Feb 16, 2016 7:03:40 AM org.jooq.tools.JooqLogger info
INFO: Generating table : UdvPublishinghistory.java [input=udv_PublishingHistory, output=udv_PublishingHistory, pk=N/A]
Feb 16, 2016 7:03:40 AM org.jooq.tools.JooqLogger info
INFO: Generating table : UdvScreamertanksystems.java [input=udv_ScreamerTankSystems, output=udv_ScreamerTankSystems, pk=N/A]
Feb 16, 2016 7:03:40 AM org.jooq.tools.JooqLogger info
INFO: Generating table : UdvSiradwmconfig.java [input=udv_SiraDWMConfig, output=udv_SiraDWMConfig, pk=N/A]
Feb 16, 2016 7:03:40 AM org.jooq.tools.JooqLogger info
INFO: Generating table : Vwauditlog.java [input=vwAuditLog, output=vwAuditLog, pk=N/A]
Feb 16, 2016 7:03:40 AM org.jooq.tools.JooqLogger info
INFO: Generating table : Vwcompanysitetanksystem.java [input=vwCompanySiteTankSystem, output=vwCompanySiteTankSystem, pk=N/A]
Feb 16, 2016 7:03:40 AM org.jooq.tools.JooqLogger info
INFO: Generating table : Vwdocketdeliveries.java [input=vwDocketDeliveries, output=vwDocketDeliveries, pk=N/A]
Feb 16, 2016 7:03:40 AM org.jooq.tools.JooqLogger info
INFO: Tables generated : Total: 01:06
Feb 16, 2016 7:03:40 AM org.jooq.tools.JooqLogger info
INFO: Generating table references
Feb 16, 2016 7:03:40 AM org.jooq.tools.JooqLogger info
INFO: Table refs generated : Total: 01:06, +17.847ms
Feb 16, 2016 7:03:40 AM org.jooq.tools.JooqLogger info
INFO: Generating Keys
Feb 16, 2016 7:03:40 AM org.jooq.tools.JooqLogger info
INFO: Keys generated : Total: 01:06, +49.833ms
Feb 16, 2016 7:03:40 AM org.jooq.tools.JooqLogger info
INFO: Generating table records
Feb 16, 2016 7:03:40 AM org.jooq.tools.JooqLogger info
INFO: Generating record : _Tmptsis_20151019Record.java
Feb 16, 2016 7:03:40 AM org.jooq.tools.JooqLogger info
INFO: Generating record : DataRecord.java
Feb 16, 2016 7:03:40 AM org.jooq.tools.JooqLogger info
INFO: Generating record : FuncgetchasedatatableRecord.java
Feb 16, 2016 7:03:40 AM org.jooq.tools.JooqLogger info
INFO: Generating record : FuncgetcompliancestatisticspasstableRecord.java
Feb 16, 2016 7:03:40 AM org.jooq.tools.JooqLogger info
INFO: Generating record : FuncgetcurrentfailsinctableRecord.java
Feb 16, 2016 7:03:40 AM org.jooq.tools.JooqLogger info
Feb 16, 2016 7:03:40 AM org.jooq.tools.JooqLogger info
INFO: Generating record : TcalibrationsRecord.java
Feb 16, 2016 7:03:40 AM org.jooq.tools.JooqLogger info
INFO: Generating record : TcompaniesRecord.java
Feb 16, 2016 7:03:40 AM org.jooq.tools.JooqLogger info
INFO: Generating record : TcompanyfilereadersRecord.java
Feb 16, 2016 7:03:40 AM org.jooq.tools.JooqLogger info
INFO: Generating record : TcompanyrolecontactsRecord.java
Feb 16, 2016 7:03:40 AM org.jooq.tools.JooqLogger info
INFO: Generating record : TcompanyrolepermissionsRecord.java
Feb 16, 2016 7:03:40 AM org.jooq.tools.JooqLogger info
INFO: Generating record : TcompanyrolesRecord.java
Feb 16, 2016 7:03:40 AM org.jooq.tools.JooqLogger info
INFO: Generating record : TcontactregionsRecord.java
Feb 16, 2016 7:03:40 AM org.jooq.tools.JooqLogger info
INFO: Generating record : TcontactsRecord.java
Feb 16, 2016 7:03:40 AM org.jooq.tools.JooqLogger info
INFO: Generating record : TcontactsitesRecord.java
Feb 16, 2016 7:03:40 AM org.jooq.tools.JooqLogger info
INFO: Generating record : TcorrectiongroupRecord.java
Feb 16, 2016 7:03:40 AM org.jooq.tools.JooqLogger info
INFO: Generating record : TcorrectiongroupsiteRecord.java
Feb 16, 2016 7:03:40 AM org.jooq.tools.JooqLogger info
INFO: Generating record : TdomainusersRecord.java
Feb 16, 2016 7:03:40 AM org.jooq.tools.JooqLogger info
INFO: Generating record : TfilereadersRecord.java
Feb 16, 2016 7:03:40 AM org.jooq.tools.JooqLogger info
INFO: Generating record : TgradealiasesRecord.java
Feb 16, 2016 7:03:40 AM org.jooq.tools.JooqLogger info
INFO: Generating record : TgradesRecord.java
Feb 16, 2016 7:03:40 AM org.jooq.tools.JooqLogger info
INFO: Generating record : TimportedfilemessagesRecord.java
Feb 16, 2016 7:03:40 AM org.jooq.tools.JooqLogger info
INFO: Generating record : TimportedfilesRecord.java
Feb 16, 2016 7:03:40 AM org.jooq.tools.JooqLogger info
INFO: Generating routine : SpCreatediagram.java
Feb 16, 2016 7:03:43 AM org.jooq.tools.JooqLogger info
INFO: Generating routine : SpDropdiagram.java
Feb 16, 2016 7:03:45 AM org.jooq.tools.JooqLogger info
INFO: Generating routine : SpHelpdiagramdefinition.java
Feb 16, 2016 7:03:45 AM org.jooq.tools.JooqLogger info
INFO: Generating routine : SpHelpdiagrams.java
Feb 16, 2016 7:03:46 AM org.jooq.tools.JooqLogger info
INFO: Generating routine : SpRenamediagram.java
Feb 16, 2016 7:03:46 AM org.jooq.tools.JooqLogger info
INFO: Routines generated : Total: 01:11, +5.132s
Feb 16, 2016 7:03:46 AM org.jooq.tools.JooqLogger info
INFO: Packages fetched : 0 (0 included, 0 excluded)
Feb 16, 2016 7:03:46 AM org.jooq.tools.JooqLogger info
INFO: Removing excess files
Feb 16, 2016 7:03:46 AM org.jooq.tools.JooqLogger info
INFO: GENERATION FINISHED: dbo : Total: 01:11, +2.713ms