JdbcMeta implements Meta { RuntimeException propagate(Throwable e) { if (e instanceof RuntimeException) { throw (RuntimeException) e; } else if (e instanceof Error) { throw (Error) e; } else { throw new RuntimeException(e); } } JdbcMeta(String url);  JdbcMeta(final String url, final String user, final String password);  JdbcMeta(String url, Properties info); Map<DatabaseProperty, Object> getDatabaseProperties(ConnectionHandle ch); MetaResultSet getTables(ConnectionHandle ch, String catalog, Pat schemaPattern,
      Pat tableNamePattern, List<String> typeList); MetaResultSet getColumns(ConnectionHandle ch, String catalog, Pat schemaPattern,
      Pat tableNamePattern, Pat columnNamePattern); MetaResultSet getSchemas(ConnectionHandle ch, String catalog, Pat schemaPattern); MetaResultSet getCatalogs(ConnectionHandle ch); MetaResultSet getTableTypes(ConnectionHandle ch); MetaResultSet getProcedures(ConnectionHandle ch, String catalog, Pat schemaPattern,
      Pat procedureNamePattern); MetaResultSet getProcedureColumns(ConnectionHandle ch, String catalog, Pat schemaPattern,
      Pat procedureNamePattern, Pat columnNamePattern); MetaResultSet getColumnPrivileges(ConnectionHandle ch, String catalog, String schema,
      String table, Pat columnNamePattern); MetaResultSet getTablePrivileges(ConnectionHandle ch, String catalog, Pat schemaPattern,
      Pat tableNamePattern); MetaResultSet getBestRowIdentifier(ConnectionHandle ch, String catalog, String schema,
      String table, int scope, boolean nullable); MetaResultSet getVersionColumns(ConnectionHandle ch, String catalog, String schema,
      String table); MetaResultSet getPrimaryKeys(ConnectionHandle ch, String catalog, String schema,
      String table); MetaResultSet getImportedKeys(ConnectionHandle ch, String catalog, String schema,
      String table); MetaResultSet getExportedKeys(ConnectionHandle ch, String catalog, String schema,
      String table); MetaResultSet getCrossReference(ConnectionHandle ch, String parentCatalog,
      String parentSchema, String parentTable, String foreignCatalog,
      String foreignSchema, String foreignTable); MetaResultSet getTypeInfo(ConnectionHandle ch); MetaResultSet getIndexInfo(ConnectionHandle ch, String catalog, String schema,
      String table, boolean unique, boolean approximate); MetaResultSet getUDTs(ConnectionHandle ch, String catalog, Pat schemaPattern,
      Pat typeNamePattern, int[] types); MetaResultSet getSuperTypes(ConnectionHandle ch, String catalog, Pat schemaPattern,
      Pat typeNamePattern); MetaResultSet getSuperTables(ConnectionHandle ch, String catalog, Pat schemaPattern,
      Pat tableNamePattern); MetaResultSet getAttributes(ConnectionHandle ch, String catalog, Pat schemaPattern,
      Pat typeNamePattern, Pat attributeNamePattern); MetaResultSet getClientInfoProperties(ConnectionHandle ch); MetaResultSet getFunctions(ConnectionHandle ch, String catalog, Pat schemaPattern,
      Pat functionNamePattern); MetaResultSet getFunctionColumns(ConnectionHandle ch, String catalog, Pat schemaPattern,
      Pat functionNamePattern, Pat columnNamePattern); MetaResultSet getPseudoColumns(ConnectionHandle ch, String catalog, Pat schemaPattern,
      Pat tableNamePattern, Pat columnNamePattern); Iterable<Object> createIterable(StatementHandle handle, QueryState state,
      Signature signature, List<TypedValue> parameterValues, Frame firstFrame); StatementHandle createStatement(ConnectionHandle ch); @Override void closeStatement(StatementHandle h); @Override void openConnection(ConnectionHandle ch,
      Map<String, String> info); @Override void closeConnection(ConnectionHandle ch); @Override ConnectionProperties connectionSync(ConnectionHandle ch,
      ConnectionProperties connProps); StatementHandle prepare(ConnectionHandle ch, String sql,
      long maxRowCount); ExecuteResult prepareAndExecute(StatementHandle h, String sql,
      long maxRowCount, PrepareCallback callback); boolean syncResults(StatementHandle sh, QueryState state, long offset); Frame fetch(StatementHandle h, long offset, int fetchMaxRowCount); @Override ExecuteResult execute(StatementHandle h,
      List<TypedValue> parameterValues, long maxRowCount); static final long UNLIMITED_COUNT; }
@Test public void testExceptionPropagation() throws SQLException { JdbcMeta meta = new JdbcMeta("url"); final Throwable e = new Exception(); final RuntimeException rte; try { meta.propagate(e); fail("Expected an exception to be thrown"); } catch (RuntimeException caughtException) { rte = caughtException; assertThat(rte.getCause(), is(e)); } }