Class JDBCEmitter

All Implemented Interfaces:
Closeable, AutoCloseable, Emitter, TikaExtension

public class JDBCEmitter extends AbstractEmitter implements Closeable
Emitter to write parsed documents to a JDBC database.

Example JSON configuration:

 {
   "emitters": {
     "jdbc-emitter": {
       "my-db": {
         "connection": "jdbc:postgresql://localhost/mydb",
         "createTable": "CREATE TABLE IF NOT EXISTS docs (path VARCHAR(1024), content TEXT)",
         "insert": "INSERT INTO docs (path, content) VALUES (?, ?)",
         "keys": {
           "tika:content": "string"
         },
         "attachmentStrategy": "FIRST_ONLY",
         "multivaluedFieldStrategy": "CONCATENATE"
       }
     }
   }
 }
 

This is only an initial, basic implementation of an emitter for JDBC. It is currently NOT thread safe because of the shared prepared statement, and depending on the jdbc implementation because of the shared connection.