This commit is contained in:
zyyang 2021-01-05 13:29:59 +08:00
parent f1896f54e9
commit 243d58d1fa
3 changed files with 8 additions and 11 deletions

View File

@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.taosdata.jdbc</groupId>
<artifactId>jdbcChecker</artifactId>
<artifactId>JDBCDemo</artifactId>
<version>SNAPSHOT</version>
<packaging>jar</packaging>
<build>
@ -23,7 +23,7 @@
<configuration>
<archive>
<manifest>
<mainClass>com.taosdata.example.JdbcDemo</mainClass>
<mainClass>com.taosdata.example.JDBCDemo</mainClass>
</manifest>
</archive>
<descriptorRefs>

View File

@ -1,4 +1,4 @@
# How to Run the JDBC Demo Code On A Linux OS
# How to Run the JDBC Demo Code On Linux OS
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>
@ -6,14 +6,11 @@ TDengine's JDBC demo project is organized in a Maven way so that users can easil
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.
## How to run jdbcChecker
<pre>mvn clean compile exec:java -Dexec.mainClass="com.taosdata.example.JdbcChecker" -Dexec.args="-host localhost"</pre>
## How to run jdbcTaosDemo
## Run jdbcDemo using mvn plugin
run command:
<pre> mvn clean compile exec:java -Dexec.mainClass="com.taosdata.example.jdbcTaosdemo.JdbcTaosdemo"</pre>
<pre> mvn clean compile exec:java -Dexec.mainClass="com.taosdata.example.JdbcDemo"</pre>
and run with your customed args
<pre>mvn clean compile exec:java -Dexec.mainClass="com.taosdata.example.jdbcTaosdemo.JdbcTaosdemo" -Dexec.args="-host localhost"</pre>
<pre>mvn clean compile exec:java -Dexec.mainClass="com.taosdata.example.JdbcDemo" -Dexec.args="-host [HOSTNAME]"</pre>
## Compile the Demo Code and Run It

View File

@ -5,7 +5,7 @@ import com.taosdata.jdbc.TSDBDriver;
import java.sql.*;
import java.util.Properties;
public class JdbcDemo {
public class JDBCDemo {
private static String host;
private static final String dbName = "test";
private static final String tbName = "weather";
@ -22,7 +22,7 @@ public class JdbcDemo {
return;
}
JdbcDemo demo = new JdbcDemo();
JDBCDemo demo = new JDBCDemo();
demo.init();
demo.createDatabase();
demo.useDatabase();