@@ -26,7 +26,7 @@ resulting errors see [this section.](#synchronous-writes)
26
26
``` java
27
27
InfluxDB influxDB = InfluxDBFactory . connect(" http://172.17.0.2:8086" , " root" , " root" );
28
28
String dbName = " aTimeSeries" ;
29
- influxDB. query(new Query (" CREATE DATABASE " + dbName, " " ));
29
+ influxDB. query(new Query (" CREATE DATABASE " + dbName));
30
30
influxDB. setDatabase(dbName);
31
31
String rpName = " aRetentionPolicy" ;
32
32
influxDB. createRetentionPolicy(rpName, dbName, " 30d" , " 30m" , 2 , true );
@@ -50,7 +50,7 @@ influxDB.write(Point.measurement("disk")
50
50
Query query = new Query (" SELECT idle FROM cpu" , dbName);
51
51
influxDB. query(query);
52
52
influxDB. dropRetentionPolicy(rpName, dbName);
53
- influxDB. deleteDatabase( dbName);
53
+ influxDB. query( new Query ( " DROP DATABASE " + dbName) );
54
54
influxDB. close();
55
55
```
56
56
@@ -86,7 +86,7 @@ If your points are written into different databases and retention policies, the
86
86
``` java
87
87
InfluxDB influxDB = InfluxDBFactory . connect(" http://172.17.0.2:8086" , " root" , " root" );
88
88
String dbName = " aTimeSeries" ;
89
- influxDB. query(new Query (" CREATE DATABASE " + dbName, " " ));
89
+ influxDB. query(new Query (" CREATE DATABASE " + dbName));
90
90
String rpName = " aRetentionPolicy" ;
91
91
influxDB. createRetentionPolicy(rpName, dbName, " 30d" , " 30m" , 2 , true );
92
92
@@ -110,7 +110,7 @@ influxDB.write(dbName, rpName, point2);
110
110
Query query = new Query (" SELECT idle FROM cpu" , dbName);
111
111
influxDB. query(query);
112
112
influxDB. dropRetentionPolicy(rpName, dbName);
113
- influxDB. deleteDatabase( dbName);
113
+ influxDB. query( new Query ( " DROP DATABASE " + dbName) );
114
114
influxDB. close();
115
115
```
116
116
@@ -121,7 +121,7 @@ If you want to write the data points immediately to InfluxDB (and handle the err
121
121
``` java
122
122
InfluxDB influxDB = InfluxDBFactory . connect(" http://172.17.0.2:8086" , " root" , " root" );
123
123
String dbName = " aTimeSeries" ;
124
- influxDB. query(new Query (" CREATE DATABASE " + dbName, " " ));
124
+ influxDB. query(new Query (" CREATE DATABASE " + dbName));
125
125
String rpName = " aRetentionPolicy" ;
126
126
influxDB. createRetentionPolicy(rpName, dbName, " 30d" , " 30m" , 2 , true );
127
127
@@ -148,7 +148,7 @@ influxDB.write(batchPoints);
148
148
Query query = new Query (" SELECT idle FROM cpu" , dbName);
149
149
influxDB. query(query);
150
150
influxDB. dropRetentionPolicy(rpName, dbName);
151
- influxDB. deleteDatabase( dbName);
151
+ influxDB. query( new Query ( " DROP DATABASE " + dbName) );
152
152
```
153
153
154
154
#### Try-with-resources
0 commit comments