コード例 #1
0
ファイル: PgServerThread.java プロジェクト: hongtaq/Lealone
 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;
 }