Package org.apache.tika.eval.app.io
Class DBWriter
- java.lang.Object
-
- org.apache.tika.eval.app.io.DBWriter
-
- All Implemented Interfaces:
IDBWriter
public class DBWriter extends Object implements IDBWriter
This is still in its early stages. The idea is to get something working with h2 and then add to that as necessary.Beware, this deletes the db file with each initialization.
Each thread must construct its own DBWriter because each DBWriter creates its own PreparedStatements at initialization.
-
-
Constructor Summary
Constructors Constructor Description DBWriter(Connection connection, List<TableInfo> tableInfos, JDBCUtil dbUtil, MimeBuffer mimeBuffer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()This closes the writer by executing batch and committing changes.intgetMimeId(String mimeString)voidwriteRow(TableInfo table, Map<Cols,String> data)
-
-
-
Constructor Detail
-
DBWriter
public DBWriter(Connection connection, List<TableInfo> tableInfos, JDBCUtil dbUtil, MimeBuffer mimeBuffer) throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
-
Method Detail
-
writeRow
public void writeRow(TableInfo table, Map<Cols,String> data) throws IOException
- Specified by:
writeRowin interfaceIDBWriter- Throws:
IOException
-
close
public void close() throws IOExceptionThis closes the writer by executing batch and committing changes. This DOES NOT close the connection- Specified by:
closein interfaceIDBWriter- Throws:
IOException
-
-