@Test void prepare() throws SQLException { String sql = RandomStringUtils.randomAlphabetic(30); when(connection.prepareStatement(any())).thenReturn(preparedStatement); PreparedStatement actual = ConnectionUtil.prepare(connection, sql); verify(connection).prepareStatement(sql); verifyNoMoreInteractions(connection); assertThat(actual, sameInstance(preparedStatement)); }
public static PreparedStatement prepare(Connection connection, String sql) { try { return connection.prepareStatement(sql); } catch (SQLException e) { throw new RuntimeSqlException(e); } }
ConnectionUtil extends UtilityClass { public static PreparedStatement prepare(Connection connection, String sql) { try { return connection.prepareStatement(sql); } catch (SQLException e) { throw new RuntimeSqlException(e); } } }
ConnectionUtil extends UtilityClass { public static PreparedStatement prepare(Connection connection, String sql) { try { return connection.prepareStatement(sql); } catch (SQLException e) { throw new RuntimeSqlException(e); } }  }
ConnectionUtil extends UtilityClass { public static PreparedStatement prepare(Connection connection, String sql) { try { return connection.prepareStatement(sql); } catch (SQLException e) { throw new RuntimeSqlException(e); } }  static DatabaseMetaData getMetaData(Connection connection); static void commit(Connection connection); static void rollback(Connection connection); static boolean execute(Connection connection, String sql); static PreparedStatement prepare(Connection connection, String sql); }
ConnectionUtil extends UtilityClass { public static PreparedStatement prepare(Connection connection, String sql) { try { return connection.prepareStatement(sql); } catch (SQLException e) { throw new RuntimeSqlException(e); } }  static DatabaseMetaData getMetaData(Connection connection); static void commit(Connection connection); static void rollback(Connection connection); static boolean execute(Connection connection, String sql); static PreparedStatement prepare(Connection connection, String sql);  }