public class JDBCSequentialFileFactoryDriver extends AbstractJDBCDriver
Modifier and Type | Field and Description |
---|---|
protected PreparedStatement |
appendToLargeObject |
protected PreparedStatement |
copyFileRecord |
protected PreparedStatement |
createFile |
protected PreparedStatement |
deleteFile |
protected PreparedStatement |
readLargeObject |
protected PreparedStatement |
renameFile |
protected PreparedStatement |
selectFileByFileName |
protected PreparedStatement |
selectFileNamesByExtension |
connection, sqlProvider
Modifier and Type | Method and Description |
---|---|
long |
calculateReadLength(long objectLength,
int bufferSpace,
long readPosition) |
void |
copyFileData(JDBCSequentialFile fileFrom,
JDBCSequentialFile fileTo)
Copy the data content of FileFrom to FileTo
|
void |
createFile(JDBCSequentialFile file)
Creates a new database row representing the supplied file.
|
protected void |
createSchema() |
void |
deleteFile(JDBCSequentialFile file)
Deletes the associated row in the database.
|
void |
destroy()
Drop all tables and data
|
long |
fileExists(JDBCSequentialFile file)
Checks to see if a file with filename and extension exists.
|
long |
getMaxSize() |
List<String> |
listFiles(String extension) |
void |
loadFile(JDBCSequentialFile file)
Loads an existing file.
|
void |
openFile(JDBCSequentialFile file)
Opens the supplied file.
|
protected void |
prepareStatements() |
int |
readFromFile(JDBCSequentialFile file,
ByteBuffer bytes)
Reads data from the file (at file.readPosition) into the byteBuffer.
|
void |
renameFile(JDBCSequentialFile file,
String newFileName)
Updates the fileName field to the new value.
|
int |
writeToFile(JDBCSequentialFile file,
byte[] data)
Persists data to this files associated database mapping.
|
createTable, getConnection, setConnection, setDataSource, setJdbcConnectionUrl, setJdbcDriverClass, setNetworkTimeout, setSqlProvider, start, stop
protected PreparedStatement deleteFile
protected PreparedStatement createFile
protected PreparedStatement selectFileByFileName
protected PreparedStatement copyFileRecord
protected PreparedStatement renameFile
protected PreparedStatement readLargeObject
protected PreparedStatement appendToLargeObject
protected PreparedStatement selectFileNamesByExtension
protected void createSchema() throws SQLException
createSchema
in class AbstractJDBCDriver
SQLException
protected void prepareStatements() throws SQLException
prepareStatements
in class AbstractJDBCDriver
SQLException
public void openFile(JDBCSequentialFile file) throws SQLException
file
- SQLException
public long fileExists(JDBCSequentialFile file) throws SQLException
file
- SQLException
public void loadFile(JDBCSequentialFile file) throws SQLException
file
- SQLException
public void createFile(JDBCSequentialFile file) throws SQLException
file
- SQLException
public void renameFile(JDBCSequentialFile file, String newFileName) throws SQLException
file
- newFileName
- SQLException
public void deleteFile(JDBCSequentialFile file) throws SQLException
file
- SQLException
public int writeToFile(JDBCSequentialFile file, byte[] data) throws SQLException
file
- data
- SQLException
public int readFromFile(JDBCSequentialFile file, ByteBuffer bytes) throws SQLException
file
- bytes
- SQLException
public void copyFileData(JDBCSequentialFile fileFrom, JDBCSequentialFile fileTo) throws SQLException
fileFrom
- fileTo
- SQLException
public void destroy() throws SQLException
destroy
in class AbstractJDBCDriver
SQLException
public long calculateReadLength(long objectLength, int bufferSpace, long readPosition)
public long getMaxSize()
Copyright © 2017 JBoss by Red Hat. All rights reserved.