fix: refine example (#22325)
* fix: use latest version of jdbc connector * fix: remove locale and timezone to avoid confusing user * fix: update readme.md
This commit is contained in:
parent
434f410987
commit
67bca400c4
|
@ -20,18 +20,12 @@ 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
|
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 run JDBCDemo.jar, execute
|
||||||
```
|
```
|
||||||
mvn clean package assembly:single
|
java -jar target/JDBCDemo-SNAPSHOT-jar-with-dependencies.jar -host [HOSTNAME]
|
||||||
```
|
|
||||||
|
|
||||||
To run JDBCDemo.jar, go to ``TDengine/tests/examples/JDBC/JDBCDemo`` and execute
|
|
||||||
```
|
|
||||||
java -Djava.ext.dirs=../../../../src/connector/jdbc/target:$JAVA_HOME/jre/lib/ext -jar target/JDBCDemo-SNAPSHOT-jar-with-dependencies.jar -host [HOSTNAME]
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -16,8 +16,6 @@ public class JdbcRestfulDemo {
|
||||||
|
|
||||||
Properties properties = new Properties();
|
Properties properties = new Properties();
|
||||||
properties.setProperty("charset", "UTF-8");
|
properties.setProperty("charset", "UTF-8");
|
||||||
properties.setProperty("locale", "en_US.UTF-8");
|
|
||||||
properties.setProperty("timezone", "UTC-8");
|
|
||||||
|
|
||||||
Connection conn = DriverManager.getConnection(url, properties);
|
Connection conn = DriverManager.getConnection(url, properties);
|
||||||
Statement stmt = conn.createStatement();
|
Statement stmt = conn.createStatement();
|
||||||
|
|
Loading…
Reference in New Issue