Package org.apache.tika.eval.app.db
Class JDBCUtil
- java.lang.Object
-
- org.apache.tika.eval.app.db.JDBCUtil
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJDBCUtil.CREATE_TABLE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidbatchInsert(PreparedStatement insertStatement, TableInfo table, Map<Cols,String> data)booleancontainsTable(String tableName)voidcreateTables(List<TableInfo> tableInfos, JDBCUtil.CREATE_TABLE createTable)booleandropTableIfExists(Connection conn, String tableName)ConnectiongetConnection()Override this any optimizations you want to do on the db before writing/reading.StringgetConnectionString()StringgetJDBCDriverClass()JDBC driver class.Set<String>getTables(Connection connection)static voidupdateInsertStatement(int dbColOffset, PreparedStatement st, ColInfo colInfo, String value)
-
-
-
Method Detail
-
batchInsert
public static void batchInsert(PreparedStatement insertStatement, TableInfo table, Map<Cols,String> data) throws SQLException
- Throws:
SQLException
-
updateInsertStatement
public static void updateInsertStatement(int dbColOffset, PreparedStatement st, ColInfo colInfo, String value) throws SQLException- Throws:
SQLException
-
getConnection
public Connection getConnection() throws SQLException
Override this any optimizations you want to do on the db before writing/reading.- Returns:
- Throws:
IOExceptionSQLException
-
getJDBCDriverClass
public String getJDBCDriverClass()
JDBC driver class. Override as necessary.- Returns:
-
dropTableIfExists
public boolean dropTableIfExists(Connection conn, String tableName) throws SQLException
- Throws:
SQLException
-
getConnectionString
public String getConnectionString()
-
getTables
public Set<String> getTables(Connection connection) throws SQLException
- Throws:
SQLException
-
createTables
public void createTables(List<TableInfo> tableInfos, JDBCUtil.CREATE_TABLE createTable) throws SQLException, IOException
- Throws:
SQLExceptionIOException
-
containsTable
public boolean containsTable(String tableName) throws SQLException
- Throws:
SQLException
-
-