com.sun.jdo.spi.persistence.generator.database
Class DatabaseOutputStream

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

public class DatabaseOutputStream
extends OutputStream


Constructor Summary
DatabaseOutputStream()
           
DatabaseOutputStream(Connection conn)
           
 
Method Summary
 void close()
          Closes the database connection.
 void flush()
          Commits the database connection.
 void setConnection(Connection conn)
           
 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.
 void write(String stmt)
          Executes the given statement in the database.
 
Methods inherited from class java.io.OutputStream
write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatabaseOutputStream

public DatabaseOutputStream(Connection conn)

DatabaseOutputStream

public DatabaseOutputStream()
Method Detail

close

public void close()
Closes the database connection.

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)


Copyright © 2012 GlassFish Community. All Rights Reserved.