2022-05-21 01:42:38 +00:00
|
|
|
```java title="Native Connection"
|
2022-06-13 07:32:44 +00:00
|
|
|
{{#include docs/examples/java/src/main/java/com/taos/example/JNIConnectExample.java}}
|
2022-05-21 01:42:38 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
```java title="REST Connection"
|
2022-06-13 07:32:44 +00:00
|
|
|
{{#include docs/examples/java/src/main/java/com/taos/example/RESTConnectExample.java:main}}
|
2022-05-21 01:42:38 +00:00
|
|
|
```
|
|
|
|
|
|
2024-12-02 09:01:27 +00:00
|
|
|
When using REST connections, if the amount of data queried is large, you can also enable batch fetching.
|
2022-05-21 01:42:38 +00:00
|
|
|
|
2024-12-02 09:01:27 +00:00
|
|
|
```java title="Enable Batch Fetching" {4}
|
2022-06-13 07:32:44 +00:00
|
|
|
{{#include docs/examples/java/src/main/java/com/taos/example/WSConnectExample.java:main}}
|
2022-05-21 01:42:38 +00:00
|
|
|
```
|
|
|
|
|
|
2024-12-02 09:01:27 +00:00
|
|
|
For more connection parameter configurations, refer to [Java Connector](../../connector/java)
|