Package org.apache.derby.impl.load
Class ExportWriteData
java.lang.Object
org.apache.derby.impl.load.ExportWriteDataAbstract
org.apache.derby.impl.load.ExportWriteData
- All Implemented Interfaces:
PrivilegedExceptionAction<Object>
final class ExportWriteData
extends ExportWriteDataAbstract
implements PrivilegedExceptionAction<Object>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate OutputStreamWriter
private byte[]
private char[]
private ByteArrayOutputStream
private OutputStreamWriter
private long
private BufferedOutputStream
private String
private boolean
private String
Fields inherited from class org.apache.derby.impl.load.ExportWriteDataAbstract
columnDefinition, columnLengths, controlFileReader, dataCodeset, dataLocale, doubleDelimiter, fieldSeparator, fieldStartDelimiter, fieldStopDelimiter, format, hasDelimiterAtEnd, nullString, recordSeparator
-
Constructor Summary
ConstructorsConstructorDescriptionExportWriteData
(String outputFileName, String lobsFileName, ControlInfo controlFileReader) ExportWriteData
(String outputFileName, ControlInfo controlFileReader) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
init()
private String
makeDoubleDelimiterString
(String inputString, String charDelimiter) Convert the input string into double delimiter format for export.void
if nothing more to write, then close the file and write a message of completion in message fileprivate void
final Object
run()
(package private) String
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.(package private) String
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.(package private) void
writeColumnDefinitionOptionally
(String[] columnNames, String[] columnTypes) if control file says true for column definition, write it as first line of the data filevoid
write the passed row into the data fileprivate void
writeNextColumn
(String oneColumn, boolean isNumeric) Methods inherited from class org.apache.derby.impl.load.ExportWriteDataAbstract
loadPropertiesInfo, setColumnLengths
-
Field Details
-
outputFileName
-
lobsFileName
-
lobsInExtFile
private boolean lobsInExtFile -
lobFileOffset
private long lobFileOffset -
aStream
-
lobCharStream
-
lobOutBinaryStream
-
lobByteArrayStream
-
byteBuf
private byte[] byteBuf -
charBuf
private char[] charBuf
-
-
Constructor Details
-
ExportWriteData
ExportWriteData(String outputFileName, ControlInfo controlFileReader) throws Exception - Throws:
Exception
-
ExportWriteData
ExportWriteData(String outputFileName, String lobsFileName, ControlInfo controlFileReader) throws Exception - Throws:
Exception
-
-
Method Details
-
init
- Throws:
Exception
-
run
- Specified by:
run
in interfacePrivilegedExceptionAction<Object>
- Throws:
Exception
-
openFiles
- Throws:
Exception
-
writeColumnDefinitionOptionally
if control file says true for column definition, write it as first line of the data file- Specified by:
writeColumnDefinitionOptionally
in classExportWriteDataAbstract
- Throws:
Exception
- if there is an error
-
writeNextColumn
- Throws:
Exception
-
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.- Specified by:
writeBinaryColumnToExternalFile
in classExportWriteDataAbstract
- Parameters:
istream
- input streams that contains a binary column data.- Returns:
- Location where the column data written in the external file.
- Throws:
Exception
- if any error occurs while writing the data.
-
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.- Specified by:
writeCharColumnToExternalFile
in classExportWriteDataAbstract
- Parameters:
ir
- Reader that contains a clob column data.- Returns:
- Location where the column data written in the external file.
- Throws:
Exception
- if any error occurs while writing the data.
-
writeData
write the passed row into the data file- Specified by:
writeData
in classExportWriteDataAbstract
- Throws:
Exception
- if there is an error
-
noMoreRows
if nothing more to write, then close the file and write a message of completion in message file- Specified by:
noMoreRows
in classExportWriteDataAbstract
- Throws:
Exception
- if there is an errorIOException
-
makeDoubleDelimiterString
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."
-