示例#1
0
 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);
   }
 }
示例#2
0
文件: Csv.java 项目: kanishin/Lealone
 /** INTERNAL */
 public void close() {
   IOUtils.closeSilently(input);
   input = null;
   IOUtils.closeSilently(output);
   output = null;
 }