Skip to content

taosdata/taos-connector-jdbc

Repository files navigation

TDengine Java Connector

GitHub Actions Workflow Status codecov GitHub commit activity GitHub License Maven Central Version
Twitter Follow YouTube Channel Discord Community LinkedIn StackOverflow

English | 简体中文

Table of Contents

1. Introduction

taos-jdbcdriver is the official Java connector for TDengine, allowing Java developers to develop applications that access the TDengine database. taos-jdbcdriver implements the standard interfaces of the JDBC driver and supports functions such as data writing, querying, subscription, schemaless writing, and parameter binding.

2. Documentation

  • For development examples, see Developer Guide, which includes how an application can introduce the taos-jdbcdriver, as well as examples of data writing, querying, schemaless writing, parameter binding, and data subscription.
  • For other reference information, see Reference Manual, which includes version history, data types, example programs, API descriptions, and FAQs.
  • To learn about TDengine, you can visit the official documentation.

3. Prerequisites

  • Java 1.8 or above runtime environment and Maven 3.6 or above installed, with environment variables correctly set.
  • TDengine has been deployed locally. For specific steps, please refer to Deploy TDengine, and taosd and taosAdapter have been started.

4. Build

Execute mvn clean package in the project directory to build the project.

5. Testing

5.1 Test Execution

Execute mvn test in the project directory to run the tests. The test cases will connect to the local TDengine server and taosAdapter for testing. After running the tests, the result similar to the following will be printed eventually. If all test cases pass, both Failures and Errors will be 0.

[INFO] Results:
[INFO] 
[WARNING] Tests run: 2353, Failures: 0, Errors: 0, Skipped: 16

5.2 Test Case Addition

All tests are located in the src/test/java/com/taosdata/jdbc directory of the project. The directory is divided according to the functions being tested. You can add new test files or add test cases in existing test files. The test cases use the JUnit framework. Generally, a connection is established and a database is created in the before method, and the database is droped and the connection is released in the after method.

5.3 Performance Testing

Performance testing is in progress.

6. CI/CD

7. Submitting Issues

We welcome the submission of GitHub Issue. When submitting, please provide the following information:

  • Problem description, whether it always occurs, and it's best to include a detailed call stack.
  • JDBC driver version.
  • JDBC connection parameters (username and password not required).
  • TDengine server version.

8. Submitting PRs

We welcome developers to contribute to this project. When submitting PRs, please follow these steps:

  1. Fork this project, refer to (how to fork a repo).
  2. Create a new branch from the main branch with a meaningful branch name (git checkout -b my_branch). Do not modify the main branch directly.
  3. Modify the code, ensure all unit tests pass, and add new unit tests to verify the changes.
  4. Push the changes to the remote branch (git push origin my_branch).
  5. Create a Pull Request on GitHub (how to create a pull request).
  6. After submitting the PR, you can find your PR through the Pull Request. Click on the corresponding link to see if the CI for your PR has passed. If it has passed, it will display "All checks have passed". Regardless of whether the CI passes or not, you can click "Show all checks" -> "Details" to view the detailed test case logs.
  7. After submitting the PR, if CI passes, you can find your PR on the codecov page to check the test coverage.

9. References

10. License

MIT License

About

Connecting Java Application With a TDengine Database.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages