Top Fields Constructors Methods
org.apache.derby.impl.load

pack-priv final Class ExportWriteData

extends ExportWriteDataAbstract
Class Inheritance
Imports
java.io.FileOutputStream, .BufferedOutputStream, .OutputStreamWriter, .ByteArrayOutputStream, .InputStream, .Reader, .IOException, .File, java.util.Date, org.apache.derby.iapi.services.io.FileUtil

Field Summary

Modifier and TypeField and Description
private OutputStreamWriter
private byte[]
private char[]
private ByteArrayOutputStream
private OutputStreamWriter
private long
private BufferedOutputStream
private String
private boolean
private String
Inherited from org.apache.derby.impl.load.ExportWriteDataAbstract:
columnDefinitioncolumnLengthscontrolFileReaderdataCodesetdataLocaledoubleDelimiterfieldSeparatorfieldStartDelimiterfieldStopDelimiterformathasDelimiterAtEndnullStringrecordSeparator

Constructor Summary

AccessConstructor and Description
pack-priv
ExportWriteData(String outputFileName, ControlInfo controlFileReader)

pack-priv
ExportWriteData(String outputFileName, String lobsFileName, ControlInfo controlFileReader)

Method Summary

Modifier and TypeMethod and Description
private void
init()

private String
makeDoubleDelimiterString(String inputString, String charDelimiter)

Convert the input string into double delimiter format for export.

public void
noMoreRows()

Implements abstract org.apache.derby.impl.load.ExportWriteDataAbstract.noMoreRows.

if nothing more to write, then close the file and write a message of completion in message file

private void
public final Object
run()

pack-priv String

Returns:

Location where the column data written in the external file.
writeBinaryColumnToExternalFile
(InputStream
input streams that contains a binary column data.
istream
)

Implements abstract org.apache.derby.impl.load.ExportWriteDataAbstract.writeBinaryColumnToExternalFile.

Writes the binary data in the given input stream to an external lob export file, and return it's location information in the file as string.

pack-priv String

Returns:

Location where the column data written in the external file.
writeCharColumnToExternalFile
(Reader
Reader that contains a clob column data.
ir
)

Implements abstract org.apache.derby.impl.load.ExportWriteDataAbstract.writeCharColumnToExternalFile.

Writes the clob data in the given input Reader to an external lob export file, and return it's location information in the file as string.

pack-priv void
writeColumnDefinitionOptionally(String[] columnNames, String[] columnTypes)

Implements abstract org.apache.derby.impl.load.ExportWriteDataAbstract.writeColumnDefinitionOptionally.

if control file says true for column definition, write it as first line of the data file

public void
writeData(String[] oneRow, boolean[] isNumeric)

Implements abstract org.apache.derby.impl.load.ExportWriteDataAbstract.writeData.

write the passed row into the data file

private void
writeNextColumn(String oneColumn, boolean isNumeric)

Inherited from org.apache.derby.impl.load.ExportWriteDataAbstract:
loadPropertiesInfosetColumnLengths

Field Detail

aStreamback to summary
private OutputStreamWriter aStream
byteBufback to summary
private byte[] byteBuf
charBufback to summary
private char[] charBuf
lobByteArrayStreamback to summary
private ByteArrayOutputStream lobByteArrayStream
lobCharStreamback to summary
private OutputStreamWriter lobCharStream
lobFileOffsetback to summary
private long lobFileOffset
lobOutBinaryStreamback to summary
private BufferedOutputStream lobOutBinaryStream
lobsFileNameback to summary
private String lobsFileName
lobsInExtFileback to summary
private boolean lobsInExtFile
outputFileNameback to summary
private String outputFileName

Constructor Detail

ExportWriteDataback to summary
pack-priv ExportWriteData(String outputFileName, ControlInfo controlFileReader) throws Exception
ExportWriteDataback to summary
pack-priv ExportWriteData(String outputFileName, String lobsFileName, ControlInfo controlFileReader) throws Exception

Method Detail

initback to summary
private void init() throws Exception
makeDoubleDelimiterStringback to summary
private String makeDoubleDelimiterString(String inputString, String charDelimiter)

Convert the input string into double delimiter format for export. double character delimiter recognition in delimited format files applies to the export and import utilities. Character delimiters are permitted within the character-based fields of a file. This applies to fields of type CHAR, VARCHAR, LONGVARCHAR, or CLOB. Any pair of character delimiters found between the enclosing character delimiters is imported into the database. For example with doble quote(") as character delimiter "What a ""nice""day!" will be imported as: What a "nice"day! In the case of export, the rule applies in reverse. For example, I am 6"tall. will be exported to a file as: "I am 6""tall."

noMoreRowsback to summary
public void noMoreRows() throws IOException

Implements abstract org.apache.derby.impl.load.ExportWriteDataAbstract.noMoreRows.

if nothing more to write, then close the file and write a message of completion in message file

Exceptions
Exception:
if there is an error
openFilesback to summary
private void openFiles() throws Exception
runback to summary
public final Object run() throws Exception
writeBinaryColumnToExternalFileback to summary
pack-priv String writeBinaryColumnToExternalFile(InputStream istream) throws Exception

Implements abstract org.apache.derby.impl.load.ExportWriteDataAbstract.writeBinaryColumnToExternalFile.

Writes the binary data in the given input stream to an external lob export file, and return it's location information in the file as string. Location information is written in the main export file.

Parameters
istream:InputStream

input streams that contains a binary column data.

Returns:String

Location where the column data written in the external file.

Exceptions
Exception:
if any error occurs while writing the data.
writeCharColumnToExternalFileback to summary
pack-priv String writeCharColumnToExternalFile(Reader ir) throws Exception

Implements abstract org.apache.derby.impl.load.ExportWriteDataAbstract.writeCharColumnToExternalFile.

Writes the clob data in the given input Reader to an external lob export file, and return it's location information in the file as string. Location information is written in the main export file.

Parameters
ir:Reader

Reader that contains a clob column data.

Returns:String

Location where the column data written in the external file.

Exceptions
Exception:
if any error occurs while writing the data.
writeColumnDefinitionOptionallyback to summary
pack-priv void writeColumnDefinitionOptionally(String[] columnNames, String[] columnTypes) throws Exception

Implements abstract org.apache.derby.impl.load.ExportWriteDataAbstract.writeColumnDefinitionOptionally.

if control file says true for column definition, write it as first line of the data file

Exceptions
Exception:
if there is an error
writeDataback to summary
public void writeData(String[] oneRow, boolean[] isNumeric) throws Exception

Implements abstract org.apache.derby.impl.load.ExportWriteDataAbstract.writeData.

write the passed row into the data file

Exceptions
Exception:
if there is an error
writeNextColumnback to summary
private void writeNextColumn(String oneColumn, boolean isNumeric) throws Exception