private static void installPgCatalog(Statement stat) throws SQLException { Reader r = null; try { r = new InputStreamReader( new ByteArrayInputStream( Utils.getResource("/com/codefollower/lealone/server/pg/pg_catalog.sql"))); ScriptReader reader = new ScriptReader(r); while (true) { String sql = reader.readStatement(); if (sql == null) { break; } stat.execute(sql); } reader.close(); } catch (IOException e) { throw DbException.convertIOException(e, "Can not read pg_catalog resource"); } finally { IOUtils.closeSilently(r); } }
/** INTERNAL */ public void close() { IOUtils.closeSilently(input); input = null; IOUtils.closeSilently(output); output = null; }