Skip to content

Commit 98a0dab

Browse files
committed
README: replace deprecated createDatabase()-call. #524 #581
1 parent 78f6146 commit 98a0dab

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ resulting errors see [this section.](#synchronous-writes)
2626
```java
2727
InfluxDB influxDB = InfluxDBFactory.connect("http://172.17.0.2:8086", "root", "root");
2828
String dbName = "aTimeSeries";
29-
influxDB.createDatabase(dbName);
29+
influxDB.query(new Query("CREATE DATABASE " + dbName,""));
3030
influxDB.setDatabase(dbName);
3131
String rpName = "aRetentionPolicy";
3232
influxDB.createRetentionPolicy(rpName, dbName, "30d", "30m", 2, true);
@@ -86,7 +86,7 @@ If your points are written into different databases and retention policies, the
8686
```java
8787
InfluxDB influxDB = InfluxDBFactory.connect("http://172.17.0.2:8086", "root", "root");
8888
String dbName = "aTimeSeries";
89-
influxDB.createDatabase(dbName);
89+
influxDB.query(new Query("CREATE DATABASE " + dbName,""));
9090
String rpName = "aRetentionPolicy";
9191
influxDB.createRetentionPolicy(rpName, dbName, "30d", "30m", 2, true);
9292

@@ -121,7 +121,7 @@ If you want to write the data points immediately to InfluxDB (and handle the err
121121
```java
122122
InfluxDB influxDB = InfluxDBFactory.connect("http://172.17.0.2:8086", "root", "root");
123123
String dbName = "aTimeSeries";
124-
influxDB.createDatabase(dbName);
124+
influxDB.query(new Query("CREATE DATABASE " + dbName,""));
125125
String rpName = "aRetentionPolicy";
126126
influxDB.createRetentionPolicy(rpName, dbName, "30d", "30m", 2, true);
127127

0 commit comments

Comments
 (0)