1、generatorConfig.xml
Modify <!--Database connection information: driver class, connection address, user name, password-->
<jdbcConnection driverClass="com.microsoft.sqlserver.jdbc.SQLServerDriver"
connectionURL="jdbc:sqlserver://127.0.0.1:1433;DatabaseName=database name"
userId="account"
password="password">
</jdbcConnection>
<!--schema do not fill in the value -->
<table schema="" tableName="Database table name" domainObjectName="Entity class name (optional)"
enableCountByExample="false" enableUpdateByExample="false"
enableDeleteByExample="false" enableSelectByExample="false"
selectByExampleQueryId="false">
</table>
2、jdbc.properties
<!--Modify the values of Driver and Url-->
driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
url=jdbc:sqlserver://127.0.0.1:1433/database name
3 、 pom.xml
<!-- Import Sqlserver database connection jar package-->
<dependency>
<groupId>com.hynnet</groupId>
<artifactId>sqljdbc4-chs</artifactId>
<version>4.0.2206.100</version>
</dependency>
4. Java version error
<!--Add --> after build
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>