Class CreateScriptFile

java.lang.Object
org.h2.samples.CreateScriptFile

public class CreateScriptFile extends Object
This sample application shows how to manually create an encrypted and compressed script file.
  • Constructor Details

    • CreateScriptFile

      public CreateScriptFile()
  • Method Details

    • main

      public static void main(String... args) throws Exception
      This method is called when executing this sample application from the command line.
      Parameters:
      args - the command line parameters
      Throws:
      Exception - on failure
    • openScriptWriter

      public static PrintWriter openScriptWriter(String fileName, String compressionAlgorithm, String cipher, String password, String charset) throws IOException
      Open a script writer.
      Parameters:
      fileName - the file name (the file will be overwritten)
      compressionAlgorithm - the compression algorithm (uppercase)
      cipher - the encryption algorithm or null
      password - the encryption password
      charset - the character set (for example UTF-8)
      Returns:
      the print writer
      Throws:
      IOException - on failure
    • openScriptReader

      public static LineNumberReader openScriptReader(String fileName, String compressionAlgorithm, String cipher, String password, String charset) throws IOException
      Open a script reader.
      Parameters:
      fileName - the file name (the file will be overwritten)
      compressionAlgorithm - the compression algorithm (uppercase)
      cipher - the encryption algorithm or null
      password - the encryption password
      charset - the character set (for example UTF-8)
      Returns:
      the script reader
      Throws:
      IOException - on failure