Skip to content

Commit c3c27bb

Browse files
committed
Make example throw exception
1 parent 2e121e6 commit c3c27bb

File tree

1 file changed

+8
-12
lines changed
  • examples/jdbc/src/main/java/com/clickhouse/examples/jdbc

1 file changed

+8
-12
lines changed

examples/jdbc/src/main/java/com/clickhouse/examples/jdbc/Basic.java

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,27 +21,23 @@ public class Basic {
2121
private static final Logger log = LoggerFactory.getLogger(Basic.class);
2222
static final String TABLE_NAME = "jdbc_example_basic";
2323

24-
public static void main(String[] args) {
24+
public static void main(String[] args) throws Exception {
2525
String url = System.getProperty("chUrl", "jdbc:ch://localhost:8123");
2626

2727
// Set user and password if needed
2828
Properties properties = new Properties();
2929
properties.setProperty("user", System.getProperty("chUser", "default"));
3030
properties.setProperty("password", System.getProperty("chPassword", ""));
3131

32-
try {
33-
createTable(url, properties);
34-
insertDateWithPreparedStatement(url, properties);
35-
printInsertedData(url, properties);
32+
createTable(url, properties);
33+
insertDateWithPreparedStatement(url, properties);
34+
printInsertedData(url, properties);
3635

37-
//Customizing client settings
38-
setClientSettings(properties);
36+
//Customizing client settings
37+
setClientSettings(properties);
3938

40-
//Using HikariCP with ClickHouseDataSource
41-
usedPooledConnection(url, properties);
42-
} catch (SQLException e) {
43-
log.error("Error", e);
44-
}
39+
//Using HikariCP with ClickHouseDataSource
40+
usedPooledConnection(url, properties);
4541
}
4642

4743
static void createTable(String url, Properties properties) throws SQLException {

0 commit comments

Comments
 (0)