public class BindUploader extends Object implements Closeable
| Modifier and Type | Method and Description |
|---|---|
static int |
arrayBindValueCount(Map<String,ParameterBindingDTO> bindValues)
Compute the number of array bind values in the given bind map
|
void |
close()
Close uploader, deleting the local temporary directory
|
int |
getFileCount()
Return the number of files that binding data is split into on internal stage.
|
String |
getStagePath()
Return the stage path to which binds are uploaded
|
static boolean |
isArrayBind(Map<String,ParameterBindingDTO> bindValues)
Return whether the bind map uses array binds
|
static BindUploader |
newInstance(SFBaseSession session,
String stageDir)
Create a new BindUploader which will upload to the given stage path.
|
void |
setInputStreamBufferSize(int bufferSize)
Set the approximate maximum size in bytes for a single bind file
|
void |
upload(Map<String,ParameterBindingDTO> bindValues)
Wrapper around upload() with default compression to true.
|
void |
upload(Map<String,ParameterBindingDTO> bindValues,
boolean compressData)
Upload bind parameters via streaming.
|
public static BindUploader newInstance(SFBaseSession session, String stageDir)
session - the session to use for uploading bindsstageDir - the stage path to upload topublic void upload(Map<String,ParameterBindingDTO> bindValues) throws BindException, SQLException
BindExceptionSQLExceptionpublic void upload(Map<String,ParameterBindingDTO> bindValues, boolean compressData) throws BindException, SQLException
bindValues - the bind map to uploadcompressData - whether or not to compress dataBindExceptionSQLExceptionpublic void close()
This class can be used in a try-with-resources statement, which ensures that the temporary directory is cleaned up even when exceptions occur
close in interface Closeableclose in interface AutoCloseablepublic void setInputStreamBufferSize(int bufferSize)
bufferSize - size in bytespublic int getFileCount()
public String getStagePath()
public static int arrayBindValueCount(Map<String,ParameterBindingDTO> bindValues)
bindValues - the bind mappublic static boolean isArrayBind(Map<String,ParameterBindingDTO> bindValues)
bindValues - the bind mapCopyright © 2022. All rights reserved.