Java SDK
GreptimeDB Java ingester 库使用 gRPC 协议写入数据, 请参考 Java 库文档查看更多使用内容。
请使用以下信息连接到 GreptimeCloud:
- Host:
<host> - Port:
5001 - Database:
<dbname> - Username:
<username> - Password:
<password>
下方的代码片段展示了如何连接到数据库:
1. String database = "<dbname>";
2. String[] endpoints = {"<host>:5001"};
3. AuthInfo authInfo = new AuthInfo("<username>", "<password>");
4. GreptimeOptions opts = GreptimeOptions.newBuilder(endpoints, database)
5. .authInfo(authInfo)
6. .tlsOptions(new TlsOptions())
7. .build();
8. GreptimeDB client = GreptimeDB.create(opts);
