Skip to content

Commit 46bef15

Browse files
committed
add example.
1 parent 497e697 commit 46bef15

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

config/checkstyle/checkstyle.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
<property name="format" value="System\.(out|err)\.print(ln)?"/>
1313
<property name="message" value="Use logging framework instead of System.out.println"/>
1414
<property name="illegalPattern" value="true"/>
15-
<property name="files" value="^(?!databend-jdbc/com/databend/jdbc/examples/).*\.java$"/>
1615
</module>
1716

1817
<!-- 其他规则 -->

databend-jdbc/src/main/java/com/databend/jdbc/examples/LoadToTableFromStream.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ static void uploadAndCopy() throws SQLException {
3232
DatabendConnection databendConnection = conn.unwrap(DatabendConnection.class);
3333
databendConnection.uploadStream(inputStream, stageName, prefix, fileName, fileSize, false);
3434

35-
// optional list
35+
// https://docs.databend.com/sql/sql-functions/table-functions/list-stage
3636
String sql = String.format("list %s", path);
3737
try(ResultSet rs = stmt.executeQuery(sql)) {
3838
while (rs.next()) {
39-
System.out.println(rs.getString(1));
39+
rs.getString(1);
4040
}
4141
}
4242

@@ -45,9 +45,7 @@ static void uploadAndCopy() throws SQLException {
4545
sql = String.format("copy into table1 from %s file_format =(type=csv) purge=true", path);
4646
try(ResultSet rs = stmt.executeQuery(sql)) {
4747
while (rs.next()) {
48-
System.out.println( rs.getString("FILE") + ", " +
49-
rs.getInt("ROWS_LOADED") + ", " +
50-
rs.getInt("ERRORS_SEEN"));
48+
rs.getString("File");
5149
}
5250
}
5351
} catch (IOException e) {

0 commit comments

Comments
 (0)