Github user Fokko commented on a diff in the pull request:
https://github.com/apache/spark/pull/22399#discussion_r216962424
--- Diff: core/src/test/java/org/apache/spark/JavaJdbcRDDSuite.java ---
@@ -39,30 +39,27 @@ public void setUp() throws ClassNotFoundException,
SQLException {
sc = new JavaSparkContext("local", "JavaAPISuite");
Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
- Connection connection =
-
DriverManager.getConnection("jdbc:derby:target/JavaJdbcRDDSuiteDb;create=true");
- try {
- Statement create = connection.createStatement();
- create.execute(
- "CREATE TABLE FOO(" +
- "ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1,
INCREMENT BY 1)," +
- "DATA INTEGER)");
- create.close();
+ try (Connection connection =
DriverManager.getConnection("jdbc:derby:target/JavaJdbcRDDSuiteDb;create=true"))
{
+
+ try(Statement create = connection.createStatement()) {
+ create.execute(
+ "CREATE TABLE FOO(" +
+ "ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY
(START WITH 1, INCREMENT BY 1)," +
+ "DATA INTEGER)");
--- End diff --
This one is horrible yes
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]