This commit is contained in:
zyyang 2021-01-05 14:33:11 +08:00
parent bcc8dabd03
commit af9e38b522
1 changed files with 7 additions and 10 deletions

View File

@ -21,21 +21,18 @@ mvn clean compile exec:java -Dexec.mainClass="com.taosdata.example.JdbcDemo" -De
``` ```
## Compile the Demo Code and Run It ## Compile the Demo Code and Run It
To compile taos-jdbcdriver, go to the source directory ``TDengine/src/connector/jdbc`` and execute
```
mvn clean package -Dmaven.test.skip=true
```
To compile the demo project, go to the source directory ``TDengine/tests/examples/JDBC/JDBCDemo`` and execute To compile the demo project, go to the source directory ``TDengine/tests/examples/JDBC/JDBCDemo`` and execute
``` ```
cd TDengine/src/connector/jdbc
mvn clean package -Dmaven.test.skip=true
cp target/taos-jdbcdriver-2.0.x-dist.jar ../../../tests/examples/JDBC/JDBCDemo/target/
cd ../../../tests/examples/JDBC/JDBCDemo
mvn clean package assembly:single mvn clean package assembly:single
``` ```
To run it, go to ``TDengine/tests/examples/JDBC/JDBCDemo/target`` and execute To run JDBCDemo.jar, go to ``TDengine/tests/examples/JDBC/JDBCDemo`` and execute
``` ```
java -Djava.ext.dirs=.:$JAVA_HOME/jre/lib/ext -jar JDBCDemo-SNAPSHOT-jar-with-dependencies.jar -host localhost java -Djava.ext.dirs=../../../../src/connector/jdbc/target:$JAVA_HOME/jre/lib/ext -jar target/JDBCDemo-SNAPSHOT-jar-with-dependencies.jar -host [HOSTNAME]
``` ```