Class DatabaseOutputStream

java.lang.Object
java.io.OutputStream
com.sun.jdo.spi.persistence.generator.database.DatabaseOutputStream
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable

public class DatabaseOutputStream extends OutputStream
  • Constructor Details

    • DatabaseOutputStream

      public DatabaseOutputStream(Connection conn)
    • DatabaseOutputStream

      public DatabaseOutputStream()
  • Method Details

    • close

      public void close()
      Closes the database connection.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class OutputStream
    • flush

      public void flush()
      Commits the database connection.
      Specified by:
      flush in interface Flushable
      Overrides:
      flush in class OutputStream
    • write

      public void write(int b)
      This method is not supported in DatabaseOutputStream because it doesn't make sense to write a single int to a database stream. So always throws UnsupportedOperationException.
      Specified by:
      write in class OutputStream
      Throws:
      UnsupportedOperationException
    • write

      public void write(String stmt) throws SQLException
      Executes the given statement in the database.
      Parameters:
      stmt - SQL to be executed
      Throws:
      SQLException - Thrown if there is a problem preparing stmt as a statement, or in executing it.
    • setConnection

      public void setConnection(Connection conn)