Class DatabaseOutputStream
java.lang.Object
java.io.OutputStream
com.sun.jdo.spi.persistence.generator.database.DatabaseOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the database connection.voidflush()Commits the database connection.voidsetConnection(Connection conn) voidwrite(int b) This method is not supported in DatabaseOutputStream because it doesn't make sense to write a single int to a database stream.voidExecutes the given statement in the database.Methods inherited from class java.io.OutputStream
nullOutputStream, write, write
-
Constructor Details
-
DatabaseOutputStream
-
DatabaseOutputStream
public DatabaseOutputStream()
-
-
Method Details
-
close
public void close()Closes the database connection.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream
-
flush
public void flush()Commits the database connection.- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream
-
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:
writein classOutputStream- Throws:
UnsupportedOperationException
-
write
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
-