readme.md 1.2 KB
Newer Older
Z
change  
zyyang 已提交
1
# How to Run the JDBC Demo Code On Linux OS
J
johnnyhou327 已提交
2 3 4
TDengine's JDBC demo project is organized in a Maven way so that users can easily compile, package and run the project. If you don't have Maven on your server, you may install it using
<pre>sudo apt-get install maven</pre>

Z
zyyang 已提交
5 6 7
## Install TDengine Client
Make sure you have already installed a tdengine client on your current develop environment.
Download the tdengine package on our website: ``https://www.taosdata.com/cn/all-downloads/`` and install the client.
J
johnnyhou327 已提交
8

Z
change  
zyyang 已提交
9
## Run jdbcDemo using mvn plugin
Z
zyyang 已提交
10
run command:
Z
change  
zyyang 已提交
11
<pre> mvn clean compile exec:java -Dexec.mainClass="com.taosdata.example.JdbcDemo"</pre>
Z
zyyang 已提交
12
and run with your customed args
Z
change  
zyyang 已提交
13
<pre>mvn clean compile exec:java -Dexec.mainClass="com.taosdata.example.JdbcDemo" -Dexec.args="-host [HOSTNAME]"</pre>
Z
zyyang 已提交
14

J
johnnyhou327 已提交
15
## Compile the Demo Code and Run It
Z
zyyang 已提交
16

J
johnnyhou327 已提交
17
To compile the demo project, go to the source directory ``TDengine/tests/examples/JDBC/JDBCDemo`` and execute
Z
zyyang 已提交
18 19 20 21 22

<pre>
mvn clean package assembly:single
</pre>

Z
zyyang 已提交
23 24 25
The ``pom.xml`` is configured to package all the dependencies into one executable jar file.

To run it, go to ``examples/JDBC/JDBCDemo/target`` and execute
Z
change  
zyyang 已提交
26
<pre>java -jar JDBCDemo-SNAPSHOT-jar-with-dependencies.jar -host localhost</pre>